fopen modes Flashcards

1
Q

‘r’

A

Read from file start.
Open for reading only; place the file pointer at the beginning of the file. Return FALSE if the file doesn’t already exist.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

‘r+’

A

Read from file start and allow writing.
Open for reading and writing; place the file pointer at the beginning of the file. Return FALSE if the file doesn’t already exist.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

‘w’

A

Write from file start and truncate file.
Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file doesn’t exist, attempt to create it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

‘w+’

A

Write from file start, truncate file, and allow reading.
Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file doesn’t exist, attempt to create it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

‘a’

A

Append to file end.

Open for writing only; place the file pointer at the end of the file. If the file doesn’t exist, attempt to create it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

‘a+’

A

Append to file end and allow reading.
Open for reading and writing; place the file pointer at the end of the file. If the file doesn’t exist, attempt to create it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly