Permalink
Browse files

slurp(:createonly)

  • Loading branch information...
1 parent bee1ba3 commit 8db8fd6138938e9ffe7a8e24b16f58612eea86d8 @moritz moritz committed Jul 14, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 S32-setting-library/IO.pod
@@ -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.
@@ -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)

0 comments on commit 8db8fd6

Please sign in to comment.