File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -293,21 +293,16 @@ exception on failure::
293
293
~~~~~~~~~~~~
294
294
295
295
:method: `Symfony\\ Component\\ Filesystem\\ Filesystem::dumpFile ` saves the given
296
- contents into a file. It does this in an atomic manner: it writes a temporary
297
- file first and then moves it to the new file location when it's finished.
298
- This means that the user will always see either the complete old file or
299
- complete new file (but never a partially-written file)::
296
+ contents into a file (creating the file and its directory if they don't exist).
297
+ It does this in an atomic manner: it writes a temporary file first and then moves
298
+ it to the new file location when it's finished. This means that the user will
299
+ always see either the complete old file or complete new file (but never a
300
+ partially-written file)::
300
301
301
302
$filesystem->dumpFile('file.txt', 'Hello World');
302
303
303
304
The ``file.txt `` file contains ``Hello World `` now.
304
305
305
- If either the file or its containing directory doesn't exist, this method
306
- creates them.
307
-
308
- After writing the temporary file, this method use :method: `Symfony\\ Component\\ Filesystem\\ Filesystem::rename `
309
- and set the third argument to true, so if the file exists, it will be overridden and the old content inside will be lost.
310
-
311
306
``appendToFile ``
312
307
~~~~~~~~~~~~~~~~
313
308
You can’t perform that action at this time.
0 commit comments