-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Unix file regularity check (#20448) #20628
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about walkPattern
and walkFiles
? There is also a new module called std/dirs
which is a type safe version of std/private/osdirs
which should be patched too.
A user can just combine This was a conscious design decision :-).
|
@@ -1095,6 +1095,8 @@ type | |||
creationTime*: times.Time ## Time file was created. Not supported on all systems! | |||
blockSize*: int ## Preferred I/O block size for this object. | |||
## In some filesystems, this may vary from file to file. | |||
isRegular*: bool ## Is file regular? (on Unix some "files" | |||
## can be non-regular like FIFOs, devices) | |||
|
|||
template rawToFormalFileInfo(rawInfo, path, formalInfo): untyped = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- On *nix, are symlinks, etc. considered "regular files"?
- Windows needs to be handled. If the above question is
true
, thenisRegular
can just always be set totrue
. - If it's not too much trouble, I think it's time for
rawToFormalFileInfo
to be split into 2 different templates (one for each platform).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On *nix, are symlinks, etc. considered "regular files"?
Not really, they are a separate type of file (even links to directories). But here isRegular
can be both true
or false
depending on target. I'll think about documenting that more thorougly.
Windows needs to be handled. If the above question is true, then isRegular can just always be set to true.
Thank you. May be an omission, I'll check that.
It can be removed from |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
* Implement Unix file regularity check * update std/dirs also
* Fix nim-lang#20628 for Windows * Move isRegular - !isSpecial and onlyRegular - skipSpecial * Forgot to change it in 1 more place
* Implement Unix file regularity check * update std/dirs also
* Fix nim-lang#20628 for Windows * Move isRegular - !isSpecial and onlyRegular - skipSpecial * Forgot to change it in 1 more place
Implements #20448.