Advertisement
open('filename', mode);
file(filename, mode);
Advertisement
File Modes | Description |
---|---|
r | Searches for the file and opens it in read mode(default mode), if the file is found. |
w | Searches for the file and opens it in write mode. If the file is found, its content are overwritten. If file is not found, a new file is created. Allows you to write to the file. |
a | Searches for the file and opens it in append mode i.e. this mode allows you to append new data to the end of a file. If file is not found, a new file is created. |
t | Searches for the file and opens the file(if the file is found) in a text mode(default mode) to perform text input/output file operations. |
b | Searches for the file and opens the file(if the file is found) in a binary mode to perform binary input/output file operations. |
+ | Searches for the file, opens it to modify the content of a file by allowing both input and output operations on a file. Should be used in combination with either r, w or a mode. |
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement