mirror of
https://github.com/restic/restic.git
synced 2025-03-10 06:03:35 +00:00
37 lines
621 B
Go
37 lines
621 B
Go
|
//go:build darwin || linux || windows
|
||
|
|
||
|
package fs
|
||
|
|
||
|
import "os"
|
||
|
|
||
|
type fdMetadataHandle struct {
|
||
|
name string
|
||
|
f *os.File
|
||
|
}
|
||
|
|
||
|
var _ metadataHandle = &fdMetadataHandle{}
|
||
|
|
||
|
func newFdMetadataHandle(name string, f *os.File) *fdMetadataHandle {
|
||
|
return &fdMetadataHandle{
|
||
|
name: name,
|
||
|
f: f,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (p *fdMetadataHandle) Name() string {
|
||
|
return p.name
|
||
|
}
|
||
|
|
||
|
func (p *fdMetadataHandle) Stat() (*ExtendedFileInfo, error) {
|
||
|
fi, err := p.f.Stat()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return extendedStat(fi), nil
|
||
|
}
|
||
|
|
||
|
func (p *fdMetadataHandle) Readlink() (string, error) {
|
||
|
// FIXME
|
||
|
return os.Readlink(fixpath(p.name))
|
||
|
}
|