What is the default file offset position when we open a file in append mode?
What is the default file offset position when we open a file in append mode?
Solution
✅ Correct Option: 2
In append mode (such as "a" in C/Python), the file offset is placed at the end of the file. Every write is added after the existing content, and existing data is not overwritten.
Option 1: the beginning is the default offset for read mode ("r") and write mode ("w"). In "w" the file is also truncated first.
Memory trick: "a" for append means "add at the end".
Related questions:
2025: 20 May Shift 1
2025: 16 May Shift 1
2025: 27 May Shift 2
2026: 26 May Shift 1