Boost logo

Boost :

Subject: [boost] Lighweight header-only version of Boost.Filesystem?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-08-17 08:56:50


I use Boost.Filesystem in a C++ "script": I use C++ instead of Python or
shell script in order to be portable across operating systems.

That script is used in bootstrapping the build system of my C++ project,
and people have complained that they need to build boost.filesystem just
to be able to bootstrap the project.

This is made worse by the fact than the rest of my C++ project requires
very recent versions of Boost headers and the fact that the ABI of
filesystem has changed relatively recently.
I had instances of people having problems because they were linking old
versions of the filesystem library but using recent filesystem headers.
They had a lot of trouble compiling the correct versions of filesystem
themselves.

I would also like to ship the script at installation time. To do that I
statically link filesystem to reduce dependencies.
My pretty trivial program, however, is more than 650kB in release mode
after stripping (2.2 MB before stripping). All it does is walk a
directory recursively and create a few files. I think this is too big.

Therefore, I would really like it if there was a lightweight header-only
version of Boost.Filesystem.
I don't need the full extent of features; I just need to have the
ability to do the following portably:
  - read all files of a directory
  - create directories
  - remove files and directories
  - rename files and directories

The first point being the most important.


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