Skip to content
This repository
  • 2 commits
  • 1 file changed
  • 0 comments
  • 1 contributor

Showing 1 changed file with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. 11  S32-setting-library/IO.pod
11  S32-setting-library/IO.pod
Source Rendered
@@ -72,8 +72,8 @@ X<open>
72 72
         Any  :$nl = "\n",
73 73
         Bool :$chomp = True,
74 74
         ...
75  
-        --> IO
76  
-    ) is export returns IO::Handle
  75
+        --> IO::Handle
  76
+    ) is export
77 77
 
78 78
 A convenience function that hides most of the OO complexity.
79 79
 It will only open normal files.  Text is the default.  Note that
@@ -134,19 +134,23 @@ The routine will C<fail> if the file does not exist, or is a directory.
134 134
         Str   $contents,
135 135
         Str  :$enc = $?ENC,
136 136
         Bool :append = False,
  137
+        Bool :$createonly = False,
137 138
     )
138 139
     multi spurt (IO $fh,
139 140
         Buf   $contents,
140 141
         Bool :append = False,
  142
+        Bool :$createonly = False,
141 143
     )
142 144
     multi spurt (Str $filename,
143 145
         Str   $contents,
144 146
         Str  :$enc = $?ENC,
145 147
         Bool :append = False,
  148
+        Bool :$createonly = False,
146 149
     )
147 150
     multi spurt (Str $filename,
148 151
         Buf   $contents,
149 152
         Bool :append = False,
  153
+        Bool :$createonly = False,
150 154
     )
151 155
 
152 156
 Opens the file for writing, dumps the contents, and closes the file.
@@ -158,6 +162,9 @@ file.
158 162
 The routine will also C<fail> with the corresponding exception if there was any
159 163
 other error in opening, writing, or closing.
160 164
 
  165
+If the C<:createonly> flag was passed, C<slurp> fails if the file already
  166
+exists, and refuses to overwrite it.
  167
+
161 168
 =item chdir
162 169
 
163 170
     multi sub chdir(Str:D)

No commit comments for this range

Something went wrong with that request. Please try again.