1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00
Files
rclone/backend/local/metadata_other.go
Nick Craig-Wood d67aa9cc7b build: make rclone compile with GOOS=wasip1 GOARCH=wasm #7831
This now compiles but the link doesn't work because of

https://github.com/golang/go/issues/64856
2025-07-09 10:53:03 +01:00

28 lines
570 B
Go

//go:build dragonfly || plan9 || js || wasm
package local
import (
"fmt"
"os"
"time"
"github.com/rclone/rclone/fs"
)
// Read the time specified from the os.FileInfo
func readTime(t timeType, fi os.FileInfo) time.Time {
return fi.ModTime()
}
// 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
}