1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-30 00:00:14 +01:00
restic/internal/fs/meta_fd.go
2024-11-30 19:17:25 +01:00

37 lines
739 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) {
// localFile.cacheFI() already internally calls stat on the filehandle
panic("should never be called")
// fi, err := p.f.Stat()
// if err != nil {
// return nil, err
// }
// return extendedStat(fi), nil
}
func (p *fdMetadataHandle) Readlink() (string, error) {
return Freadlink(p.f.Fd(), fixpath(p.name))
}