diff options
| author | Jeff Carr <[email protected]> | 2025-10-07 04:46:29 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-07 04:46:29 -0500 |
| commit | 64fe482e151565805adb6aa0d300604fa4814165 (patch) | |
| tree | 63b6fa3759d8a4719a151963243e73289ea624f9 | |
| parent | e4477d94c6a1e7fd3c4b32f0078b8593398cd127 (diff) | |
startt to dump lib/gui/shellv0.0.10
| -rw-r--r-- | changed.go | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -1,6 +1,11 @@ package config -import "sync" +import ( + "os" + "runtime" + "strings" + "sync" +) // this package can provide a trivial way to track which // protobufs have been modified and need to be written to disk @@ -24,3 +29,31 @@ func SetChanged(name string, b bool) { func HasChanged(name string) bool { return saveMap[name] } + +// a simple function name shortcut +func Exists(filename string) bool { + _, err := os.Stat(Path(filename)) + if os.IsNotExist(err) { + return false + } + return true +} + +// simple function name shortcut +func IsDir(dirname string) bool { + info, err := os.Stat(Path(dirname)) + if os.IsNotExist(err) { + return false + } + return info.IsDir() +} + +// notsure if this is a thing anymore. don't care much either +func Path(filename string) string { + // log.Log(INFO, "Path() START filename =", filename) + if runtime.GOOS == "windows" { + filename = strings.Replace(filename, "/", "\\", -1) + } + // log.Log(INFO, "Path() END filename =", filename) + return filename +} |
