diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-01-19 12:07:04 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-01-19 12:07:04 -0800 |
| commit | 6a40c688e00d9bd2cbee28aae18fface408a9742 (patch) | |
| tree | 9b7e9085b0ebfbe3ade1f7c9cd195defe31b7235 | |
| parent | 39edcfde4cdd867a5c36211f9e355e2a470f87d5 (diff) | |
| download | seaweedfs-6a40c688e00d9bd2cbee28aae18fface408a9742.tar.xz seaweedfs-6a40c688e00d9bd2cbee28aae18fface408a9742.zip | |
mount: modify file size
| -rw-r--r-- | weed/filesys/file.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/filesys/file.go b/weed/filesys/file.go index b0df344fa..ca0550a87 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -50,6 +50,10 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) error { attr.Inode = uint64(util.HashStringToLong(file.fullpath())) attr.Mode = os.FileMode(file.entry.Attributes.FileMode) attr.Size = filer2.TotalSize(file.entry.Chunks) + if file.isOpen { + attr.Size = file.entry.Attributes.FileSize + } + attr.Crtime = time.Unix(file.entry.Attributes.Crtime, 0) attr.Mtime = time.Unix(file.entry.Attributes.Mtime, 0) attr.Gid = file.entry.Attributes.Gid attr.Uid = file.entry.Attributes.Uid |
