Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
slurp(:createonly)
  • Loading branch information
moritz committed Jul 14, 2012
1 parent bee1ba3 commit 8db8fd6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions S32-setting-library/IO.pod
Expand Up @@ -134,19 +134,23 @@ The routine will C<fail> if the file does not exist, or is a directory.
Str $contents,
Str :$enc = $?ENC,
Bool :append = False,
Bool :$createonly = False,
)
multi spurt (IO $fh,
Buf $contents,
Bool :append = False,
Bool :$createonly = False,
)
multi spurt (Str $filename,
Str $contents,
Str :$enc = $?ENC,
Bool :append = False,
Bool :$createonly = False,
)
multi spurt (Str $filename,
Buf $contents,
Bool :append = False,
Bool :$createonly = False,
)

Opens the file for writing, dumps the contents, and closes the file.
Expand All @@ -158,6 +162,9 @@ file.
The routine will also C<fail> with the corresponding exception if there was any
other error in opening, writing, or closing.

If the C<:createonly> flag was passed, C<slurp> fails if the file already
exists, and refuses to overwrite it.

=item chdir

multi sub chdir(Str:D)
Expand Down

0 comments on commit 8db8fd6

Please sign in to comment.