231k views
0 votes
In most languages, if a file does not exist and a program attempts to open it in append mode, what happens?

1 Answer

3 votes

Answer:

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

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.