AppendToFile |
Files | |
Aptilis 1 |
AppendToFile(FileName, Content)
AppendToFile will add a string at the end of a file.
If the file did not exist, it is created.
The path indicated should be constructed
according to your platform.
Windows/DOS way: c:\texts\accounts\year98.txt
Unix way: /texts/accounts/year98.txt
Note the different slashes...
AppendToFile does not understant the ftp:// type, but SavFile (in the internet family) does.
Return Value:
Number of bytes written.
If the value is different from the length of the string you specified,
then check the _errno variable for details.
Example:
The file myfile.txt aready contains:
Hello world -----------With the code:
appendToFile("myfile.txt","\nthird line")The file now contains:
Hello world ----------- third lineSee also loadfile, savefile.
Notes
Using AppendToFile heavily is not recommended when good performances are required.
Rather, it is better to work on a variable, append content to it and then use
SaveFile.