mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
local: add Metadata support #111
This commit is contained in:
21
backend/local/metadata_other.go
Normal file
21
backend/local/metadata_other.go
Normal file
@@ -0,0 +1,21 @@
|
||||
//go:build plan9 || js
|
||||
// +build plan9 js
|
||||
|
||||
package local
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
)
|
||||
|
||||
// Read the metadata from the file into metadata where possible
|
||||
func (o *Object) readMetadataFromFile(m *fs.Metadata) (err error) {
|
||||
info, err := o.fs.lstat(o.path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
m.Set("mode", fmt.Sprintf("%0o", info.Mode()))
|
||||
m.Set("mtime", info.ModTime().Format(metadataTimeFormat))
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user