//go:build darwin package server import "syscall" // specialFilesystem reports whether path lives on a pseudo filesystem (devfs, // autofs, fdesc) that a folder picker must never list. func specialFilesystem(path string) bool { var stat syscall.Statfs_t if err := syscall.Statfs(path, &stat); err != nil { return false } name := make([]byte, 0, len(stat.Fstypename)) for _, c := range stat.Fstypename { if c == 0 { break } name = append(name, byte(c)) } switch string(name) { case "devfs", "autofs", "fdesc": return true } return false }