Browse Source

EnsureDir() takes file mode

pull/1842/head
Jae Kwon 9 years ago
parent
commit
4b6741ca3b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      os.go

+ 2
- 2
os.go View File

@ -36,9 +36,9 @@ func Exit(s string) {
os.Exit(1) os.Exit(1)
} }
func EnsureDir(dir string) error {
func EnsureDir(dir string, mode os.FileMode) error {
if _, err := os.Stat(dir); os.IsNotExist(err) { if _, err := os.Stat(dir); os.IsNotExist(err) {
err := os.MkdirAll(dir, 0700)
err := os.MkdirAll(dir, mode)
if err != nil { if err != nil {
return fmt.Errorf("Could not create directory %v. %v", dir, err) return fmt.Errorf("Could not create directory %v. %v", dir, err)
} }


Loading…
Cancel
Save