User Tools

Site Tools


en:examples:writing_a_file:screen_shots

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:examples:writing_a_file:screen_shots [2021/11/29 12:30 (4 years ago)] – created sausageen:examples:writing_a_file:screen_shots [2021/11/30 02:06 (4 years ago)] (current) – removed sausage
Line 1: Line 1:
-====== Writing a file to disk ====== 
- 
-A short function to demonstrate writing strings to a file. If append (orxTRUE) is passed, the string is appended to the file. If orxFALSE is passed, the string overwrites the existing contents. 
- 
-<code cpp> 
-void AppendToFile(const orxSTRING string, orxBOOL append){ 
- orxS32 flags = orxFILE_KU32_FLAG_OPEN_APPEND | orxFILE_KU32_FLAG_OPEN_WRITE; 
- if (append == orxFALSE){ 
- flags =  orxFILE_KU32_FLAG_OPEN_WRITE; 
- } 
-  
- orxFILE *file = orxFile_Open ("my_file_on_disk.txt", flags);  
- orxFile_Print(file, string); 
- orxFile_Close(file); 
-} 
-</code> 
  
en/examples/writing_a_file/screen_shots.1638189045.txt.gz · Last modified: 2025/09/30 17:26 (13 days ago) (external edit)