Browse Source

os.open does r/d as default which makes a call to open a dir invalid this should fix this problem

Platin21 3 years ago
parent
commit
8b1100bf2b
2 changed files with 1 additions and 2 deletions
  1. 1 1
      core/path/filepath/walk.odin
  2. 0 1
      tools/odinfmt/main.odin

+ 1 - 1
core/path/filepath/walk.odin

@@ -71,7 +71,7 @@ _walk :: proc(info: os.File_Info, walk_proc: Walk_Proc) -> (err: os.Errno, skip_
 
 @(private)
 read_dir :: proc(dir_name: string, allocator := context.temp_allocator) -> ([]os.File_Info, os.Errno) {
-	f, err := os.open(dir_name)
+	f, err := os.open(dir_name, os.O_RDONLY)
 	if err != 0 {
 		return nil, err
 	}

+ 0 - 1
tools/odinfmt/main.odin

@@ -114,7 +114,6 @@ main :: proc() {
 		filepath.walk(path, walk_files);
 
 		for file in files {
-			fmt.println(file);
 
 			backup_path := strings.concatenate({file, "_bk"});
 			defer delete(backup_path);