Commit 6b4cf07
committed
Stop find_c aborting on directory entries
directory_entry::file_size() has no defined result for a directory. MSVC
returns the size cached by FindFirstFile (0), so on Windows the throwing
overloads used here never fire; libc++ calls stat and throws instead, so
on macOS every NewFileSearch over a folder that contains a subdirectory
died with "filesystem error: in file_size: Is a directory" before the
binding could even apply its findDirectories filter. The build list was
the visible casualty - one sub-folder under Builds/ made the startup
screen unreachable - but Main.lua's folder copy/delete walks and the
Export scripts glob directories the same way.
Query the entry through the error_code overloads and report 0 for a
directory, matching what Windows already returns. is_directory() and
last_write_time() get the same treatment: they fail out of the same
status() call, so an unreadable or dangling entry took the process down
by the identical route.1 parent 407d2f1 commit 6b4cf07
1 file changed
Lines changed: 22 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
| |||
234 | 241 | | |
235 | 242 | | |
236 | 243 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
241 | 255 | | |
242 | 256 | | |
243 | 257 | | |
| |||
0 commit comments