Multiple choice technology programming languages

How can I find out if someone else has a file open?

  1. Its not possible

  2. use isused() function

  3. Try to open file with locking enabled

  4. Try to write the file after opening

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

To detect if a file is already open by another process, the standard approach is to attempt opening it with file locking enabled. If the lock fails, another process likely has it open. Options A, B, and D are incorrect - there's no standard isused() function, and writing after opening doesn't detect existing locks.