GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — linux_utils/df.cpp at main · akamhy/linux_utils Expand file tree/ Copy pathdf.cppMore file actions 27 lines (22 loc) · 824 Bytes / Copy pathdf.cppFile metadata and controls27 lines (22 loc) · 824 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #include <iostream> #include <sys/statvfs.h> int main(int argc, char* argv[]) { if (argc < 2) { std::cerr << "Error: no mount point passed" << std::endl; return 1; } struct statvfs info; if (statvfs(argv[1], &info) != 0) { perror("statvfs"); return 1; } std::cout << "Filesystem Size Used Avail Use% Mounted on" << std::endl; std::cout << "-------------- ---- ---- ----- ---- ----------" << std::endl; std::cout << argv[1] << " "; std::cout << (info.f_blocks * info.f_frsize) << " "; std::cout << ((info.f_blocks - info.f_bfree) * info.f_frsize) << " "; std::cout << (info.f_bavail * info.f_frsize) << " "; std::cout << (info.f_blocks > 0 ? ((info.f_blocks - info.f_bfree) * 100 / info.f_blocks) : 0) << " "; std::cout << argv[1] << std::endl; return 0; } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |