Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Correctly create IO::Dir.dirname
  • Loading branch information
lizmat committed Nov 4, 2014
1 parent 49874e1 commit a49a556
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/IO/Dir.pm
Expand Up @@ -32,6 +32,10 @@ my class IO::Dir is Cool does IO::Local {

method rmdir(IO::Dir:D:) { REMOVE-DIR($!abspath) }

method dirname(IO::Local:D:) {
self!parts;
'/' ~ @!parts[1 .. *-3].join('/');
}
method basename(IO::Dir:D:) { MAKE-BASENAME($!abspath.chop) }
method extension(IO::Dir:D:) { MAKE-EXT(MAKE-BASENAME($!abspath.chop))}
method succ(IO::Dir:D:) { $!abspath.chop.succ ~ '/' }
Expand Down

0 comments on commit a49a556

Please sign in to comment.