2020-04-01 02:08:21 +00:00
|
|
|
package path
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
func WorkingDirectory() (cwd string) {
|
2020-04-11 21:29:52 +00:00
|
|
|
cwd, _ = os.Getwd()
|
2020-04-01 02:08:21 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func FileExists(filename string) bool {
|
|
|
|
info, err := os.Stat(filename)
|
|
|
|
if os.IsNotExist(err) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return !info.IsDir()
|
|
|
|
}
|
2020-04-01 13:05:44 +00:00
|
|
|
|
|
|
|
func DirExists(dirPath string) bool {
|
|
|
|
info, err := os.Stat(dirPath)
|
|
|
|
if os.IsNotExist(err) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return info.IsDir()
|
|
|
|
}
|