Multiple choice technology programming languages

15.) If open() is used to open a non-existent file in read-only mode what will happen

  1. a) Creates File

  2. b) Does nothing

  3. c) Return error

  4. d) Not allowed.

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

When using the open() system call in read-only mode (O_RDONLY) on a file that does not exist, the system cannot create the file and will return an error (setting errno to ENOENT).