Multiple choice technology operating systems

18 How do I find the size of a file inside a program?

  1. 1 Use ls -l

  2. 2 Use sizeof()

  3. 3 Use filesize()

  4. 4 Use fstat()

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

fstat() is the system call used to get file status information, including file size. It operates on file descriptors and populates a struct stat with size, permissions, and timestamps. ls -l is a shell command, sizeof() is a compile-time operator, and filesize() is not a standard function.