File and IO Operations
suggest changeParameters
| Flag | Meaning |
|---|---|
"r" |
Read-only, starts at the beginning of the file (default mode). |
"r+" |
Read-write, starts at the beginning of the file. |
"w" |
Write-only. Truncates an existing file to zero length, or creates a new file. |
"w+" |
Read-write. Truncates an existing file to zero length, or creates a new file. |
"a" |
Write-only. Starts at the end if the file exists; otherwise creates a file. |
"a+" |
Read-write. Starts at the end if the file exists; otherwise creates a file. |
"b" |
Binary mode. Suppresses EOL-to-CRLF conversion on Windows, and sets the external encoding to ASCII-8BIT unless another encoding is given. Combine it with a mode above, as in File.new("test.txt", "rb"). |
"t" |
Text mode. Combine it with a mode above, as in File.new("test.txt", "wt"). |
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents