Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use nqp::file{read,writ,execut}able/fileislink on parrot and jvm
  • Loading branch information
timo authored and moritz committed Jul 12, 2013
1 parent e587d79 commit 44b57b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/core/IO.pm
Expand Up @@ -47,24 +47,22 @@ my role IO::FileTestable does IO {
nqp::const::STAT_FILESIZE) );
}

#?if parrot
method l() {
nqp::p6bool(pir::new__Ps('File').is_link(nqp::unbox_s(self.Str)))
nqp::p6bool(nqp::fileislink(self.Str))
}

method r() {
nqp::p6bool(pir::new__Ps('OS').can_read(nqp::unbox_s(self.Str)))
nqp::p6bool(nqp::filereadable(self.Str))
}

method w() {
nqp::p6bool(pir::new__Ps('OS').can_write(nqp::unbox_s(self.Str)))
nqp::p6bool(nqp::filewritable(self.Str))
}

method x() {
nqp::p6bool(pir::new__Ps('OS').can_execute(nqp::unbox_s(self.Str)))
nqp::p6bool(nqp::fileexecutable(self.Str))
}
#?endif


method z() {
self.e && self.s == 0;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/build/NQP_REVISION
@@ -1 +1 @@
2013.06-70-g9fca92f
2013.06-156-g0d19655

0 comments on commit 44b57b5

Please sign in to comment.