Is there any good boost::filesystem alternative?
Solution 1
POCO has similar functionality which you can find under Foundation/FileSystem.
Solution 2
There is at least one more solution worth mentioning - STLSoft
, a set of BSD-like licensed libraries, contains a cross-platform wrapper under Windows & Unix native filesystem APIs - PlatformSTL
project. The benefit in comparison with boost::filesystem
is no need to build anything, the whole library is header-only, you can simply include it in your project. The bad side is lack of documentation though, I spent quite some time to figure out how to use it.
Solution 3
What about QT's QFileSystemModel
or QFSFileEngine?
Solution 4
You can find it in the SSVUtils library: https://github.com/SuperV1234/SSVUtils
Related videos on Youtube
Damian
Updated on February 08, 2020Comments
-
Damian about 4 years
Is there any portable c++ library to work with the filesystem?
I know about boost::filesystem, but I need to know if there is any other.
Thanks!
-
J T about 13 yearsAre you having problems with boost?
-
Damian about 13 yearsI'd like something that's not required to be built separately from your project. I'm looking for a simple, little library that lets me add the files to my ide project and just compile it with the rest of the code.
-
Sam Miller about 13 yearsit doesn't get much simpler than
apt-get install boost-devel
oryum install boost-devel
. If you're on Windows, BoostPro has installers. -
Lightness Races in Orbit about 9 yearsWhy are you compiling code on your iphone? :/
-
carlosvin almost 7 yearsFYK: boost::filesystem has been merged to C++17. You can start using it as experimental feature, I wrote an example at carlosvin.github.io/posts/recursive-directory-iterator
-
-
UmmaGumma about 13 yearsYou have introduced me with very nice C++ library. Thanks and +1.
-
Jeremy Sandell about 13 years+1 for POCO. While the entire library is pretty huge, you can just link to the portion you need to use (and whatever its dependencies are, if any).
-
Vortico over 10 yearsWhile POCO is huge compared to most other C++ libraries, it is dwarfed by Boost's ~100MB package.
-
void-pointer over 10 yearsThe last time I tried, STLSoft did not compile on OS X. See my question here for more details. The error generated by the library read
error: #error Operating system not discriminated. Only UNIX and Windows are currently recognised by PlatformSTL
, which is not a good sign. -
Dmitry over 10 yearsThat's news for me, never tried it on OS X. Really doesn't work. The reason seems to be that OS X does not provide predefined
UNIX
(orunix
,__unix__
,__unix
) macro. I'm not sure it would work but you can try to add the option forPLATFORMSTL_OS_IS_UNIX
macro inplatrofmstl.h
:#if defined(unix) || \ defined(UNIX) || \ defined(__unix__) || \ defined(__unix) || \ defined(__MACH__) # define PLATFORMSTL_OS_IS_UNIX
-
void-pointer over 10 yearsThanks for the information---I just accepted your answer to my question. I think I remember manually defining
#platform PLATFORM_OS_IS_UNIX
or otherwise trying to work around the error, but came across more errors using the version of STLSoft that I used when I posted that question. I suppose that it is compatible with OS X now. -
ruipacheco over 9 yearsWhy are there downloads for each platform? Shouldn't this abstract away each platform's specific features?