Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use no longer new (but still shiny) open mode :x for spurt(:createonly)
  • Loading branch information
cygx committed Nov 5, 2015
1 parent 9fad7b4 commit a8560f5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/core/IO/Path.pm
Expand Up @@ -484,10 +484,7 @@ my class IO::Path is Cool {
}

method !spurt($contents, :$enc, :$append, :$createonly, :$bin, |c) {
if $createonly and $.e {
fail("File '$!path' already exists, and :createonly was specified");
}
my $mode = $append ?? :a !! :w;
my $mode = $createonly ?? :x !! $append ?? :a !! :w;
my $handle = self.open(:enc($enc // 'utf8'), :$bin, |$mode, |c);
$handle // $handle.throw;

Expand Down

0 comments on commit a8560f5

Please sign in to comment.