zenity/file.go
2020-01-09 17:06:12 +00:00

15 lines
244 B
Go

package zenity
import (
"os"
"path/filepath"
)
func splitDirAndName(path string) (dir, name string) {
path = filepath.Clean(path)
fi, err := os.Stat(path)
if err == nil && fi.IsDir() {
return path, ""
}
return filepath.Split(path)
}