From GMod Wiki
file.Write( String filename, String contents )
Where is this used?
|Write to a specified file|
|Part of Library:||File|
|BBCode Link:||[b][url=http://wiki.garrysmod.com/?title=File.Write]File.Write [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]|
|You can only read/write text data. Binary data is not mutable inside Garry's Mod using the File library.|
|Your filenames MUST end in .txt|
|Description||This example writes "This is a test" to the my_mod/data.txt|
file.Write("my_mod/data.txt", "This is a test")
- Relative to garrysmod/data
- You cannot write to a file outside the data directory.
- You cannot write anything but *.txt files.
- Files are not opened in append mode. Files are emptied before they are written to. Use file.Append to append (add) to a file.
- The filename is decapitalized when the file is made, so "CAPSdontWORK.txt" will turn into "capsdontwork.txt" when saved
- You cannot write files with special characters such as the following, " : _ , this means you cannot save a filename as a SteamID
- As of the latest file.Write update, any filename containing a period will silently fail. This mean that you cannot use file names such as the following: "My_V1.1_Object.txt"