Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

give IO::FileTestable more methods on jvm

  • Loading branch information...
commit 82437be6996c78759bf3b9a48150579a248217ea 1 parent 2118544
@timo timo authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/core/IO.pm
View
14 src/core/IO.pm
@@ -29,7 +29,6 @@ sub prompt($msg) {
}
my role IO::FileTestable does IO {
-#?if parrot
method d() {
self.e && nqp::p6bool(nqp::stat(nqp::unbox_s(self.Str), nqp::const::STAT_ISDIR))
}
@@ -42,6 +41,13 @@ my role IO::FileTestable does IO {
self.e && nqp::p6bool(nqp::stat(nqp::unbox_s(self.Str), nqp::const::STAT_ISREG))
}
+ method s() {
+ self.e
+ && nqp::p6box_i( nqp::stat(nqp::unbox_s(self.Str),
+ nqp::const::STAT_FILESIZE) );
+ }
+
+#?if parrot
method l() {
nqp::p6bool(pir::new__Ps('File').is_link(nqp::unbox_s(self.Str)))
}
@@ -50,12 +56,6 @@ my role IO::FileTestable does IO {
nqp::p6bool(pir::new__Ps('OS').can_read(nqp::unbox_s(self.Str)))
}
- method s() {
- self.e
- && nqp::p6box_i( nqp::stat(nqp::unbox_s(self.Str),
- nqp::const::STAT_FILESIZE) );
- }
-
method w() {
nqp::p6bool(pir::new__Ps('OS').can_write(nqp::unbox_s(self.Str)))
}
Please sign in to comment.
Something went wrong with that request. Please try again.