File.write
File.write($filePath, $dataListOrString) -> false
Description
Write the given data to a file.
If the file already exists, it will be overwritten.
The $filePath
is relative to the data/files
directory.
If the data is a List, it will be joined by newlines \n
.
File.write('file.txt', 'line1\nline2\nline3') File.write('file.txt', ['line1', 'line2', 'line3'])