1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-30 00:00:14 +01:00
restic/internal/fs/freadlink_darwin.go
Michael Eischer 2a5bbf170d fs: implement and use filehandle based readlink
The implementations are 90% copy&paste from the go standard library as
the existing code does not offer any way to read the symlink target
based on a filehandle.

Fall back to a standard readlink on platforms other than Linux and
Windows as those either don't even provide the necessary syscall or in
case of macOS are not yet available in Go.
2024-11-30 19:17:25 +01:00

9 lines
202 B
Go

package fs
import "os"
// TODO macOS versions >= 13 support freadlink. Use that instead of the fallback codepath
func Freadlink(fd uintptr, name string) (string, error) {
return os.Readlink(name)
}