| Technical Specification | ||||
| Filesystem library(filesystem TS) | ||||
| Library fundamentals(library fundamentals TS) | ||||
| Library fundamentals 2(library fundamentals TS v2) | ||||
| Library fundamentals 3(library fundamentals TS v3) | ||||
| Extensions for parallelism(parallelism TS) | ||||
| Extensions for parallelism 2(parallelism TS v2) | ||||
| Extensions for concurrency(concurrency TS) | ||||
| Extensions for concurrency 2(concurrency TS v2) | ||||
| Concepts(concepts TS) | ||||
| Ranges(ranges TS) | ||||
| Reflection(reflection TS) | ||||
| Mathematical special functions(special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
| Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| File types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defined in header <experimental/filesystem> | ||
space_info space(const path& p); space_info space(const path& p, error_code& ec)noexcept; | (filesystem TS) | |
Determines the information about the filesystem on which the pathnamep is located, as if by POSIXstatvfs.
Populates and returns an object of typespace_info, set from the members of the POSIXstruct statvfs as follows:
The non-throwing overload sets all members tostatic_cast<std::uintmax_t>(-1) on error.
Contents |
| p | - | path to examine |
| ec | - | out-parameter for error reporting in the non-throwing overload |
The filesystem information (aspace_info object).
space_info.available may be less thanspace_info.free.
#include <experimental/filesystem>#include <iostream>namespace fs= std::experimental::filesystem; int main(){ fs::space_info devi= fs::space("/dev/null"); fs::space_info tmpi= fs::space("/tmp"); std::cout<<" Capacity Free Available\n"<<"/dev: "<< devi.capacity<<" "<< devi.free<<" "<< devi.available<<'\n'<<"/tmp: "<< tmpi.capacity<<' '<< tmpi.free<<' '<< tmpi.available<<'\n';}
Possible output:
Capacity Free Available/dev: 4175114240 4175110144 4175110144/tmp: 420651237376 411962273792 390570749952
| information about free and available space on the filesystem (class)[edit] |