File System - Study Mode

[#1] Which of the following functions retrieve the entire contents of a file in such a way that it can be used as part of an expression? 1. file_get_contents() 2. fgets() 3. fopen() 4. file() 5. readfile()
Correct Answer

(C) Option 1 and 4

[#2] fgets() is used to read a file one line at a time.
Correct Answer

(A) True

[#3] What is the difference between stat() and fstat()?
Correct Answer

(B) While fstat() works on open file pointers, stat() works on files specified by pathname

[#4] flock() is used to unlock a file so that two or more people do not get access to it at the same time.
Correct Answer

(B) False

[#5] Which of the following functions reads the entire contents of a file? 1. fgets() 2. file_get_contents() 3. fread() 4. readfile() 5. file()
Correct Answer

(C) Option 2, 4 and 5