loadTextFile: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{ScriptItem |endpoint = shared |type = function |name = loadTextFile |parameters = string filePath |parameter1 = string filePath The path to the file. |returnTypes = string |...") |
No edit summary |
||
Line 6: | Line 6: | ||
|parameter1 = string filePath The path to the file. | |parameter1 = string filePath The path to the file. | ||
|returnTypes = string | |returnTypes = string | ||
|usage = fetch all text inside a file.<br>The file and data returned may contain new-line character(s).<br>The data fetched is either up to the EOF (end of file) or first null-byte (\0) character, whichever occurs first.<br>This function internally opens, reads, and closes the file.<br>The file is opened in text-mode, not binary-mode. | |usage = fetch all text inside a file.<br>The file and data returned may contain new-line character(s).<br>The data fetched is either up to the EOF (end of file) or first null-byte (\0) character, whichever occurs first.<br>This function internally opens, reads, and closes the file.<br>The file is internally opened in text-mode, not binary-mode.<br>The file is internally opened in read-mode, not write-mode. | ||
|returnInfo = the data fetched, as a string, which could be an empty string | |returnInfo = the data fetched, as a string, which could be an empty string | ||
|returnFail1 = null n/a | |returnFail1 = null n/a | ||
}} | }} |
Revision as of 04:57, 2 December 2020
Function
Server and Client
Online and Offline
Available since Server 1.0.0, Client 1.0.0
string loadTextFile(string filePath)
The loadTextFile function is used to fetch all text inside a file.
The file and data returned may contain new-line character(s).
The data fetched is either up to the EOF (end of file) or first null-byte (\0) character, whichever occurs first.
This function internally opens, reads, and closes the file.
The file is internally opened in text-mode, not binary-mode.
The file is internally opened in read-mode, not write-mode.
The file and data returned may contain new-line character(s).
The data fetched is either up to the EOF (end of file) or first null-byte (\0) character, whichever occurs first.
This function internally opens, reads, and closes the file.
The file is internally opened in text-mode, not binary-mode.
The file is internally opened in read-mode, not write-mode.
Parameters
1) | string | filePath | The path to the file. |
Return
string | The data fetched, as a string, which could be an empty string. |
Notes
There aren't any notes for this function.
Examples
There aren't any examples for this function.
Compatibility
There isn't any compatibility information for this function.
Related
Server Related
createFile
fileExists
loadTextFile
openFile
saveTextFile
Client Related
createFile
fileExists
loadTextFile
openFile
saveTextFile