mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
os.open does r/d as default which makes a call to open a dir invalid this should fix this problem
This commit is contained in:
@@ -71,7 +71,7 @@ _walk :: proc(info: os.File_Info, walk_proc: Walk_Proc) -> (err: os.Errno, skip_
|
|||||||
|
|
||||||
@(private)
|
@(private)
|
||||||
read_dir :: proc(dir_name: string, allocator := context.temp_allocator) -> ([]os.File_Info, os.Errno) {
|
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 {
|
if err != 0 {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ main :: proc() {
|
|||||||
filepath.walk(path, walk_files);
|
filepath.walk(path, walk_files);
|
||||||
|
|
||||||
for file in files {
|
for file in files {
|
||||||
fmt.println(file);
|
|
||||||
|
|
||||||
backup_path := strings.concatenate({file, "_bk"});
|
backup_path := strings.concatenate({file, "_bk"});
|
||||||
defer delete(backup_path);
|
defer delete(backup_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user