Fixes #1567
This commit is contained in:
@@ -98,8 +98,8 @@ func (d *DiskSpacePrimitives) fileInfoToFileMeta(path string, info os.FileInfo)
|
||||
Name: path,
|
||||
Size: info.Size(),
|
||||
ContentType: LookupContentTypeFromPath(path),
|
||||
Created: getCreationTime(info).Unix(),
|
||||
LastModified: info.ModTime().Unix(),
|
||||
Created: getCreationTime(info).UnixMilli(),
|
||||
LastModified: info.ModTime().UnixMilli(),
|
||||
Perm: "rw",
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ func (d *DiskSpacePrimitives) WriteFile(path string, data []byte, meta *FileMeta
|
||||
|
||||
// Set modification time if provided
|
||||
if meta != nil && meta.LastModified > 0 {
|
||||
modTime := time.Unix(meta.LastModified, 0)
|
||||
modTime := time.UnixMilli(meta.LastModified)
|
||||
if err := os.Chtimes(localPath, modTime, modTime); err != nil {
|
||||
log.Printf("Failed to set the mtime for %s: %v", localPath, err)
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ func (e *ReadOnlyFallthroughSpacePrimitives) fileInfoToFileMeta(path string, inf
|
||||
Name: path,
|
||||
Size: info.Size(),
|
||||
ContentType: LookupContentTypeFromPath(path),
|
||||
Created: e.timeStamp.Unix(),
|
||||
LastModified: e.timeStamp.Unix(),
|
||||
Created: e.timeStamp.UnixMilli(),
|
||||
LastModified: e.timeStamp.UnixMilli(),
|
||||
Perm: "ro",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user