From 3ab0d9b2eba7bf4483f263f62845dbd425180852 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 9 May 2016 17:17:47 -0700 Subject: [PATCH] Get complete file details in Datastore.Stat This helper was originally optimized within govc to just check if a file exists. It isn't much more overhead to get the additional details for a single file, add the full set for convenience. --- object/datastore.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/object/datastore.go b/object/datastore.go index 14399d026..123dde8a8 100644 --- a/object/datastore.go +++ b/object/datastore.go @@ -314,8 +314,10 @@ func (d Datastore) Stat(ctx context.Context, file string) (types.BaseFileInfo, e spec := types.HostDatastoreBrowserSearchSpec{ Details: &types.FileQueryFlags{ - FileType: true, - FileOwner: types.NewBool(true), // TODO: omitempty is generated, but seems to be required + FileType: true, + FileSize: true, + Modification: true, + FileOwner: types.NewBool(true), }, MatchPattern: []string{path.Base(file)}, }