Multiple choice technology programming languages

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

  1. Use ls -l

  2. Use sizeof()

  3. Use filesize()

  4. Use fstat()

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

The fstat() system call retrieves status information about an open file descriptor, including its size in bytes, which is stored in the st_size field of the stat structure.