file.Write

From Garry's Mod
Revision as of 16:15, 4 September 2019 by Robotboy655 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 file.Write( )

Contents

Description

Writes the given string to a file. Erases all previous data in the file. To add data without deleting previous data, use file.Append.

Arguments

string fileName

The name of the file being written into. The path is relative to the data/ folder.

This argument will be forced lowercase.

The filename must end with one of the following:

  • .txt
  • .jpg
  • .png
  • .vtf
  • .dat
  • .json

Restricted symbols are:
" :

Arguments

string content

The content that will be written into the file.

Examples

Example

Writes to data/helloworld.txt.

file.Write( "helloworld.txt", "This is the content!" )


Personal tools
Navigation