Io smartmatch #15

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@worr

I implemented as many of the file test methods listed in the spec as parrot would allow.
https://github.com/perl6/specs/blob/master/S32-setting-library/IO.pod

I also re-implemented IO.l in Perl6 as opposed to pir. Finally, I fixed IO.f so that it wouldn't return Bool::True when testing device files.

worr added some commits Feb 24, 2011
@worr worr Added move to IO.pm
Added chmod

Can look at filesystem permissions

Removed unnecessary functions

- Didn't need all the stuff I wrote

Implemented copy

Added additional basic IO functions

- added rm
- added link

Turns outperl6 does support octal
47486da
@worr worr Added nodev requirement to IO.f
- spec says that regular files can be neither devices or directories

Added R(), W(), X()

Added O() and o()

Changed IO.l implementation to Perl6 instead of pir

Implemented u() g() and k()

Added some globals

Added euid

Added EGID and GID

:r actually uses the EUID now instead of UID

updated :w and :x as well

Made my code a little more Windows friendly (albeit poorly)
9a0a6e0
@worr

I added some more features to this patch.

The :r, :w, and :x smartmatch operators work as expected now, checking against euid instead of just the uid like before. This also involved adding the globals $UID, $EUID, $GID, $EGID, and $*OSNAME. I tried to match the behavior of perl6, and what was discussed in the spec.

I think a better way to handle trying to access the euid/egid of the process in Windows is to throw an exception saying that that operation isn't supported on that platform. Right now, $EUID and $EGID are just 0 on windows, and :r, :w, and :x just return their real uid equivalents.

@pmichaud pmichaud closed this Aug 1, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment