- "r"
-
Opens for reading. If the file does not exist or cannot be found, the fopen call fails.
//파일이 존재안하면 열기 실패
- "w"
-
Opens an empty file for writing. If the given file exists, its contents are destroyed.
//빈 파일을 연다. 만약 빈 파일이 아니면 파일 내용이 파괴된다.
- "a"
-
Opens for writing at the end of the file (appending) without removing the EOF marker before writing new data to the file; creates the file first if it doesn't exist.
- "r+"
-
Opens for both reading and writing. (The file must exist.)
//파일이 존재안하면 열기 실패
- "w+"
-
Opens an empty file for both reading and writing. If the given file exists, its contents are destroyed.
//파일이 존재안하지 않으면 파일 생성후 열기
- "a+"
-
Opens for reading and appending; the appending operation includes the removal of the EOF marker before new data is written to the file and the EOF marker is restored after writing is complete; creates the file first if it doesn't exist.
//파일이 존재안하지 않으면 파일 생성후 열기