How to Get Available Filesystem Space on Linux: a C Function with a C++ Example
Date: Monday, August 31, 2015 @ 10:35:38 UTC
Topic: Software


How to Get Available Filesystem Space on Linux: a C Function with a C++ Example: It is common for programs to write to files in filesystems on disks. However, what if the disk was almost full when your program writes to the filesystem on a disk? For systems software and mission critical programs, it is a better or must-to-do practice to check the available filesystem space before actually writing to files. On POSIX OSes, we have the statvfs POSIX API to get filesystem statistics (On Linux, you may use the Linux specific statfs, but POSIX APIs are better for portability). In this post, we will introduce a C function and a C++ example to use the statvfs API to get the available filesystem space. Continue reading: How to Get Available Filesystem Space on Linux: a C Function with a C++ Example at SysTutorials.







This article comes from Linux Knowledge Base and Tutorial
http://www.linux-tutorial.info

The URL for this story is:
http://www.linux-tutorial.info/modules.php?name=News&file=article&sid=12967