The 📄 class allows you to read and write to files.
It provides several class methods which are shortcuts to reading and writing. They operate always on the whole file and reading can be very inefficient using these shortcuts when working with big files, because they will read the whole file into memory.
You must close files openend with 📝 and 📜 appropriately with 🙅 when they are no longer needed.
Opens the file at the given path for writing. The file pointer is set to the beginning of the file and the file is truncated to zero length or created.
You cannot read from a file opened with this initializer.
Opens the file at the given path for reading. The file pointer is set to the beginning of the file.
You cannot write to a file opened with this initializer.
Reads as many bytes as specified from the file pointer position.
Keep in mind that a byte is not equal to one character!
Seeks the file pointer to the end of the file.
❗️ 🔛 position 🔢
Seeks the file pointer to the given position.
Causes any buffered unwritten data to be written to the file.
Closes the file. Reading or writing thereafter is undefined behavior.
This class method tries to write the given 📇 to the given path. If the file already exists, it will be overwritten.