Multiple choice technology operating systems

8 The correct set of sequence for file operations for a file say 'test'

  1. 1 lseek(), open(), write(), close()

  2. 2 open(), write(), lseek(), close()

  3. 3 open(), lseek(), open(), , write() close()

  4. 4 None

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The correct sequence for file operations is open() to get a file descriptor, write() to write data (optionally using lseek() to position before writing), and close() to release resources. Option A incorrectly tries to lseek before opening, and option C has syntax errors and calls open() twice.