196k views
3 votes
5. If a file does not exist and a program attempts to open it in append mode, what happens

1 Answer

7 votes

Answer:

It create a new file in which writing of data begins.

Step-by-step explanation:

A file can be open in the three mode:

-r (Read mode): open an existing file for the purpose of reading data from it.

-w (write mode): Create a new file for the purpose of writing data to it.

-a (append mode): open an existing file for the purpose of appending extra data to it but if the file does not exist, it create a new file and start writing data to it.

User Mahinlma
by
5.3k points