-
-
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
Add staticFileExists and staticDirExists #22278
Conversation
As-is the compile error for runtime |
I know what @Araq said in that previous PR, but I would like to know why there should be
to actually work, over having to use a special-cased version. |
@Varriount There are three real things that come to mind:
|
@awr1 Fair enough. And I suppose the alternate behavior can always be implemented in the future, if necessary. |
@awr1 Thank you! |
That would probably be best: don't forget |
Thank you! I didn't aware |
|
Sorry but commit 79b5d9f was much better, we don't add magics if we can avoid it. |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
This PR partly fix #19414 .
In previus PR #22203, I tried to make
fileExists
anddirExists
in std/private/oscommon works at compile-time even when --os:any option is set.This PR adds staticos module that contains
staticFileExists
andstaticDirExists
that works likefileExists
ordirExists
but works only at compile-time even when--os:any
option is set.But I cannot make calling
staticFileExists
at runtime result in compile error even if I add compileTime pragma.When I use
when nimvm
like this, error pragma is always cause error even ifstaticFileExists
is called at compile-time.