zenity/file.go

16 lines
244 B
Go
Raw Permalink Normal View History

2020-01-09 12:05:43 -05:00
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)
}