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
duplicate stat() system calls on file tests #2584
Comments
|
You can't do it, at least with current version of MoarVM https://github.com/MoarVM/MoarVM/blob/a5dd7652d4ca0ff67aac5c7809958e030abcbacf/src/io/fileops.c#L16 Basically, file stat is not expose directly to nqp side, you have to perform multiple |
|
This was the never-implemented extra part of the IO Grant: With a discussion that led to the proposal for |
|
Thanks for the clarifying information; I was not able to find the earlier discussions when I looked. If the ideas are covered elsewhere, then I would understand if you close this bug as a duplicate. Thanks, |
I think it's good to have this ticket open. I'm not aware of any other ticket on this matter in the rakudo's repo. |
The Problem
IO::Pathmethods to test file metadata (.l,.f, etc.) issue twostat()/lstat()system calls when one will suffice.Expected Behavior
A single
"foo".IO.lcall will result in a singlelstat().A single
"foo".IO.fcall will result in a singlestat().Actual Behavior
A single
"foo".IO.lcall results in two calls tolstat().A single
"foo".IO.fcall result in two calls tostat().Steps to Reproduce
Prepare:
Perl 6 test, unexpected behavior:
Perl 5 test, expected behavior:
One possible hint as to why this happens is that there is only a single call when the file is missing. It appears as if perl 6 is issuing one
stat()to determine if the file exists and then anotherstat()to gather data for the user-requested test.Environment
perl6 -v):Thanks,
Corey
The text was updated successfully, but these errors were encountered: