Dota 2 Workshop Tools/Scripting/API/Global.StringToFile: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Dota_Lebot push: Updated Page)
(Brief description of parameters, added Notes to explain some of the functions behaviour)
Line 2: Line 2:


== Function Description ==
== Function Description ==


''' bool StringToFile(string ''a'', string ''b'') '''
''' bool StringToFile(string ''a'', string ''b'') '''


''Store a ''string'' to a file for later reading''
''Store a ''string'' to a file for later reading''


== Parameters ==
== Parameters ==
Line 18: Line 15:
| string
| string
| a
| a
| No Description Set
| The file name.
|-
|-
| string
| string
| b
| b
| No Description Set
| The string to store in the file.
|}
|}


== Returns ==
== Returns ==


''bool'' - No Description Set
''bool'' - Whether or not the function was successful in storing the string in the file.
 
== Notes ==
 
* Directory traversal doesn't seem to work. The characters '.', '/' and '\\' are ignored.
* The file name cannot be blank, nor can it consist only of the ignored characters, else the function will do nothing and return false.
* Only one string can be stored at a time, the file is overwritten to at every call.
* The file ends with a NUL character.
* The files are stored at C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\dota_ugc\game\dota\ems
* The function is used in conjunction with [[Dota_2_Workshop_Tools/Scripting/API/Global.FileToString|FileToString]]

Revision as of 06:11, 9 August 2014

Note.pngNote: This page is automatically generated. Any changes may be overwritten

Function Description

bool StringToFile(string a, string b)

Store a string to a file for later reading

Parameters

Type Name Description
string a The file name.
string b The string to store in the file.

Returns

bool - Whether or not the function was successful in storing the string in the file.

Notes

  • Directory traversal doesn't seem to work. The characters '.', '/' and '\\' are ignored.
  • The file name cannot be blank, nor can it consist only of the ignored characters, else the function will do nothing and return false.
  • Only one string can be stored at a time, the file is overwritten to at every call.
  • The file ends with a NUL character.
  • The files are stored at C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\dota_ugc\game\dota\ems
  • The function is used in conjunction with FileToString