You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.
dir = directory.open(".", error_text) ?
if defined(dir)
for dir.file as f
echo "file:$(f.name) has size: $(f.size)"
endfor
else
abort "Error: " + error_text
endif
The run fails because f.name (and f.size) is undefined. But further trials also shows:
Based on the size of the enumerations, it's clear that all files and directories are enumerated (despite the dir.file qualification). This gives the same length enumeration as dir. even when there is a mix of files and directories in the opened directory.
When dir.directory is qualified, no directories (or files) are ever enumerated, the enumeration is always empty.
The enumerated objects (file and path) do define a path attribute, but it is always empty.
No documented attributes other than path are defined on returned files or directories.
This last item is not technically a break, but would make portable code hard, because presumably this is a behavior specific to Windows. But note that other path references in GSL on Windows don't require forward slashing:
The value of dir.path is correct in the case where the opened directory ends with "" but not when it ends with "/" (or when it is not terminated).
I'm encountering multiple problems attempting to use the latest build of GSL on Windows to enumerate files and/or directories.
Using the documentation as an example:
The run fails because
f.name
(andf.size
) is undefined. But further trials also shows:dir.file
qualification). This gives the same length enumeration asdir.
even when there is a mix of files and directories in the opened directory.dir.directory
is qualified, no directories (or files) are ever enumerated, the enumeration is always empty.path
attribute, but it is always empty.path
are defined on returned files or directories.This last item is not technically a break, but would make portable code hard, because presumably this is a behavior specific to Windows. But note that other path references in GSL on Windows don't require forward slashing:
dir.path
is correct in the case where the opened directory ends with "" but not when it ends with "/" (or when it is not terminated).I'm really stuck at this point. I looked through the GSL source, but it's going to be a slog for me. Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: