From 8b1100bf2b2488c181f7f8112cf079c475f5f59c Mon Sep 17 00:00:00 2001 From: Platin21 Date: Sat, 5 Feb 2022 23:12:55 +0100 Subject: [PATCH] os.open does r/d as default which makes a call to open a dir invalid this should fix this problem --- core/path/filepath/walk.odin | 2 +- tools/odinfmt/main.odin | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/path/filepath/walk.odin b/core/path/filepath/walk.odin index 29d4fd5b1..dad63cc09 100644 --- a/core/path/filepath/walk.odin +++ b/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 } diff --git a/tools/odinfmt/main.odin b/tools/odinfmt/main.odin index bc1b521ca..cebb20888 100644 --- a/tools/odinfmt/main.odin +++ b/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);