Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[spurt]: s/':new'/':createonly'/ as suggested by jnthn++.
  • Loading branch information
pmichaud committed Jul 6, 2012
1 parent 4137ad6 commit 70c1b24
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions S32-setting-library/IO.pod
Expand Up @@ -954,45 +954,46 @@ The routine will C<fail> if the file does not exist, or is a directory.
Str $contents,
Str :$enc = $?ENC,
Bool :append = False,
Bool :new = False,
Bool :createonly = False,
)
multi method spurt ($handle:
Buf $contents,
Bool :append = False,
Bool :new = False,
Bool :createonly = False,
)
multi spurt (IO $fh,
Str $contents,
Str :$enc = $?ENC,
Bool :append = False,
Bool :new = False,
Bool :createonly = False,
)
multi spurt (IO $fh,
Buf $contents,
Bool :append = False,
Bool :new = False,
Bool :createonly = False,
)
multi spurt (Str $filename,
Str $contents,
Str :$enc = $?ENC,
Bool :append = False,
Bool :new = False,
Bool :createonly = False,
)
multi spurt (Str $filename,
Buf $contents,
Bool :append = False,
Bool :new = False,
Bool :createonly = False,
)

Opens the file for writing, dumps the contents, and closes the file.

If the C<:new> flag is set and the file already exists before opening, this
routine will C<fail>. With an unset C<:new> flag, the file will instead be
silently overwritten, unless the C<:append> flag is set, in which case the
routine will instead add the given contents at the end of the file.
If the C<:createonly> flag is set and the file already exists before
opening, this routine will C<fail>. With an unset C<:createonly> flag,
the file will instead be silently overwritten, unless the C<:append>
flag is set, in which case the routine will instead add the given
contents at the end of the file.

The routine will also C<fail> with the corresponding exception if there was any
other error in opening, writing, or closing.
The routine will also C<fail> with the corresponding exception
if there was any other error in opening, writing, or closing.

=back

Expand Down

0 comments on commit 70c1b24

Please sign in to comment.