func getEntryTypeString(e *os.FileInfo) string { if e.IsDirectory() { return "/" } else if e.IsBlock() { return "<>" } else if e.IsFifo() { return ">>" } else if e.IsSymlink() { return "@" } else if e.IsSocket() { return "&" } else if e.IsRegular() && (e.Mode&0001 == 0001) { return "*" } return "" }
func symbol(f *os.FileInfo) (s string) { switch { case f.IsDirectory(): s = "/" case f.IsFifo(): s = "|" case f.IsSocket(): s = "=" case f.IsSymlink(): target, err := os.Readlink(f.Name) Errhandler(err) s = " -> " + target } return }