🟧Write

Writes the given string to a file. Erases all previous data in the file.

fs.Write( string filePath, string contents, string fileMode )

Third argument is optional, but if set to ab it will not overwrite the whole file, instead it will add the contents to the end.

There is no need to build the entire path to the file manually, if the directory does not exist when writing to the file, it will be created automatically.

If writing fails, it will throw an error.

Last updated