How to determinate a file's size in the C programming language?

Опубликовано: 30 Март 2026
на канале: myCTalkthroughs
257
8

If you are a carpenter, you often need to measure the material you are working with. If you are a C programmer, you occasionally need to measure the size of a file or determine some other property of a it. As carpenters use rulers to measure, the right tool to determinate file sizes in C comes with a function.

Well, long story short, the stat() function provides various yummy treats about a file, including its timestamps, permissions, file type, and besides others the file’s size in bytes.

#filesize #stat #stat.h #functions

If you have further questions, useful feedback, or an idea for a C-related topic to talk through please leave a comment. From time to time I will come back on your issues in upcoming episodes.

And if you liked this episode please give it a thumbs up, if you want to see more video like this, subscribe to this channel and don't forget to hit the bell if you want to stay informed, when new episodes are released.

Sources & Links:
https://github.com/jagottsicher/myCTa...
https://pubs.opengroup.org/onlinepubs...

P.S.: If you're interested to learn programming basics in #Google's #programming #language #Go feel free to have a look at my course on #Udemy: https://www.udemy.com/course/learn-pr...