September 2018
Intermediate to advanced
606 pages
14h 32m
English
The source code we will compile is one of the examples for the filesystem library provided by Boost to interact with the filesystem. This library is conveniently cross-platform and abstracts the differences between operating systems and filesystems into a coherent, high-level API. The following example code (path-info.cpp) will accept a path as an argument and print a report about its components to the screen:
#include <iostream>#include <boost/filesystem.hpp>using namespace std;using namespace boost::filesystem;const char *say_what(bool b) { return b ? "true" : "false"; }int main(int argc, char *argv[]) { if (argc < 2) { cout << "Usage: path_info path-element [path-element...]\n" "Composes a path via operator/= from one or ...Read now
Unlock full access