Commit 7ceff97
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 7ceff97
1 file changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
220 | 225 | | |
221 | 226 | | |
222 | 227 | | |
| |||
234 | 239 | | |
235 | 240 | | |
236 | 241 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
240 | 250 | | |
241 | 251 | | |
242 | 252 | | |
| |||
0 commit comments