Skip to content
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

IO::Path.dir gives numeric error in message #2649

Open
Leont opened this Issue Jan 27, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@Leont
Copy link
Contributor

Leont commented Jan 27, 2019

The Problem

When IO::Path.dir encounters an error, the error message gives a numeric error instead of an error string. Like this example:

Expected Behavior

Failed to get the directory contents of '/var/spool/cups': Permission denied

Actual Behavior

Failed to get the directory contents of '/var/spool/cups': Failed to open dir: 13

Steps to Reproduce

"/var/spool/cups".IO.dir

Environment

Rakudo 2018.12

jnthn added a commit to MoarVM/MoarVM that referenced this issue Jan 28, 2019

Call strerror for directory errors
So that we get an error text rather than an error code, as reported in
Rakudo issue rakudo/rakudo#2649. Note that
this only fixes it for the POSIX case; the Windows case probably also
needs a look into, to see how it should be done there.
@jnthn

This comment has been minimized.

Copy link
Member

jnthn commented Jan 28, 2019

Partial (POSIX only) fix added. Also created MoarVM/MoarVM#1041 after glancing the strerror docs.

@jonathanstowe

This comment has been minimized.

Copy link
Contributor

jonathanstowe commented Jan 28, 2019

The Windows CRT has a strerror IIRC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
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.