Answer:
For the above condition, and as mentioned none of the mode will work, and we need to make use of the JSON format. And we nee to use the JavaScript, and we don't need to mention the mode in JavaScript. Thus, this is nowadays used solution for this old problem that existed when we used to code using c++ and c.
Explanation:
You need to write over this text file, and you also need to read. Hence, you need to open the file with the three privileges, and the append will be required,and this way we can only move line by line. However, this is an old style. Now we save in text file in JSON format. The data collected from Form is converted to JSON format and written in text file. And as required data can be read or written, and as required. So if we use only JSON format, then we need not mention the mode, as its not required these days in new languages like JavaScript.