Finish adding simple user authentication

This commit is contained in:
2013-08-28 23:05:28 -04:00
parent 7009b0eda8
commit 9c442254a7
7 changed files with 60 additions and 21 deletions

View File

@ -28,6 +28,14 @@ func EnsureDirExists(dir string) error {
return nil
}
func FileExistsAndHasPermissions(file string, mode os.FileMode) bool {
info, err := os.Stat(file)
if err != nil {
return false
}
return info.Mode().Perm() == mode
}
//TODO maybe this shouldn't fail silently?
func RecursiveRemoveEmptyDirs(dir string) {
var err error = nil