File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1+ .packages /
Original file line number Diff line number Diff line change 1- # Toit Lock File.
1+ sdk: ^1.6.10
Original file line number Diff line number Diff line change 1- # Toit Package File.
1+ environment :
2+ sdk : ^1.6.10
Original file line number Diff line number Diff line change @@ -83,10 +83,10 @@ chdir name:
8383
8484// An open directory, used to iterate over the named entries in a directory.
8585class DirectoryStream :
86- fd_ := ?
86+ dir_ := ?
8787
8888 constructor name :
89- fd_ = opendir_ name
89+ dir_ = opendir_ resource_freeing_module_ name
9090
9191 /**
9292 Returns a string with the next name from the directory.
@@ -95,18 +95,19 @@ class DirectoryStream:
9595 */
9696 next -> string? :
9797 while true :
98- byte_array := readdir_ fd_
98+ byte_array := readdir_ dir_
9999 if not byte_array : return null
100100 str := byte_array .to_string
101101 if str == "." or str == ".." : continue
102102 return str
103103
104104 close -> none :
105- fd := fd_
106- closedir_ fd
105+ if dir_ :
106+ closedir_ dir_
107+ dir_ = null
107108
108- opendir_ name :
109- #primitive .file .opendir
109+ opendir_ resource_group name :
110+ #primitive .file .opendir2
110111
111112readdir_ dir -> ByteArray :
112113 #primitive .file .readdir
You can’t perform that action at this time.
0 commit comments