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

From Valve Developer Community
Jump to navigation Jump to search
(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
| No Description Set
| The file name.
|}
|}


== Returns ==
== Returns ==


''string'' - No Description Set
''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

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

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