File I/O
Reading Files
Section titled “Reading Files”You can read the entire content of a file into a string.
str content = read_file("test.txt");print(content);Writing Files
Section titled “Writing Files”You can write content to a file. This will overwrite the existing content.
write_file("test.txt", "Hello Tulpar!");Appending to Files
Section titled “Appending to Files”You can append content to the end of a file.
append_file("test.txt", "\nNew line");Checking Existence
Section titled “Checking Existence”You can check if a file exists.
bool exists = file_exists("test.txt");if (exists) { print("File found!");}