pctroll pctroll - 1 year ago 74
C++ Question

How can I know the type of a file using Boost.Filesystem?

I'm using Boost but I cannot find complete (or good) documentation about the filesystem library in the installation directory nor the web. The "-ls" example I found has been quite a helper but it's not enough.

Thanks in advance :)

Answer Source

How about:


The functions for figuring out the file type (directory, normal file etc.) is found on this subpage: http://www.boost.org/doc/libs/1_39_0/libs/filesystem/doc/reference.html#file_status

If you are looking for the file extension check out: template <class Path> typename Path::string_type extension(const Path &p); on the page: http://www.boost.org/doc/libs/1_39_0/libs/filesystem/doc/reference.html#Convenience-functions

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download