Boost logo

Boost :

From: Benjamin Dauvergne (feanor_at_[hidden])
Date: 2003-06-10 17:27:19


Try to compile with(this is on a debian):

g++ test-fs-boost.cc -o test-fs-boost /usr/lib/libboost_filesystem.a

-= test-fs-boost.cc =-
#include <iostream>
#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>

namespace fs = boost::filesystem;

int main(int argc, char *argv[]) {
        fs::path home("/home/coin"); // it doesn't exist

        try {
                if (fs::is_directory(home)) {
                        std::cout << home.string() << " is a directory";
                } else {
                        std::cout << home.string() << " isn't a
directory";
                }
        } catch(fs::filesystem_error &e) {
                std::cout << "Error send by " << e.who();
                exit(-1);
        }
        exit(0);
}
-=-

There isn't an implementation in exception.cpp neither in filesystem/
exception.hpp.

Merci


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk