Skip to content

Commit

Permalink
Move allomorphs.pm before IO so IO::Path.mode can return an IntStr
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterDuke17 committed May 25, 2016
1 parent 7036028 commit 9bfd0c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/core/IO/Path.pm
Original file line number Diff line number Diff line change
Expand Up @@ -623,11 +623,12 @@ my class IO::Path is Cool {
!! fail X::IO::DoesNotExist.new(:path(~self),:trying<changed>)
}

method mode(:$Str) {
method mode(--> IntStr) {
$.e
?? $Str
?? sprintf('%04o', nqp::stat($!abspath, nqp::const::STAT_PLATFORM_MODE) +& 0o7777)
!! nqp::stat($!abspath, nqp::const::STAT_PLATFORM_MODE)
?? STATEMENT_LIST(
my int $mode = nqp::stat($!abspath, nqp::const::STAT_PLATFORM_MODE) +& 0o7777;
IntStr.new($mode, sprintf('%04o', $mode));
)
!! fail X::IO::DoesNotExist.new(:path(~self),:trying<mode>)
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/build/moar_core_sources
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ src/core/Match.pm
src/core/Cursor.pm
src/core/Grammar.pm
src/core/Regex.pm
src/core/allomorphs.pm
src/core/IO.pm
src/core/IO/Spec.pm
src/core/IO/Spec/Unix.pm
Expand All @@ -89,7 +90,6 @@ src/core/io_operators.pm
src/core/IO/ArgFiles.pm
src/core/AST.pm
src/core/CallFrame.pm
src/core/allomorphs.pm
src/core/Main.pm
src/core/Instant.pm
src/core/Duration.pm
Expand Down

0 comments on commit 9bfd0c8

Please sign in to comment.