Dota 2 Workshop Tools/Scripting/API/Global.FileToString: Difference between revisions
< Dota 2 Workshop Tools | Scripting | API
Jump to navigation
Jump to search
RoyAwesome (talk | contribs) (Dota_Lebot push: Updated Page) |
No edit summary |
||
Line 2: | Line 2: | ||
== Function Description == | == Function Description == | ||
''' string FileToString(string ''a'') ''' | ''' string FileToString(string ''a'') ''' | ||
''Reads a ''string'' from a file to send to script'' | ''Reads a ''string'' from a file to send to script'' | ||
== Parameters == | == Parameters == | ||
Line 18: | Line 15: | ||
| string | | string | ||
| a | | a | ||
| | | The file name. | ||
|} | |} | ||
== Returns == | == Returns == | ||
''string'' - | ''string'' - The string stored in the file. If it doesn't exist, returns nil. | ||
== Notes == | |||
* Directory traversal doesn't seem to work. The characters '.', '/' and '\\' are ignored. | |||
* The files are read from 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|StringToFile]] |
Revision as of 06:17, 9 August 2014

Function Description
string FileToString(string a)
Reads a string from a file to send to script
Parameters
Type | Name | Description |
---|---|---|
string | a | The file name. |
Returns
string - The string stored in the file. If it doesn't exist, returns nil.
Notes
- Directory traversal doesn't seem to work. The characters '.', '/' and '\\' are ignored.
- The files are read from C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\dota_ugc\game\dota\ems
- The function is used in conjunction with StringToFile