Is there any good boost::filesystem alternative?

10,744

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

Share:
10,744

Related videos on Youtube

Damian
Author by

Damian

Updated on February 08, 2020

Comments

  • Damian
    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
      J T about 13 years
      Are you having problems with boost?
    • Damian
      Damian about 13 years
      I'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
      Sam Miller about 13 years
      it doesn't get much simpler than apt-get install boost-devel or yum install boost-devel. If you're on Windows, BoostPro has installers.
    • Lightness Races in Orbit
      Lightness Races in Orbit about 9 years
      Why are you compiling code on your iphone? :/
    • carlosvin
      carlosvin almost 7 years
      FYK: 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
    UmmaGumma about 13 years
    You have introduced me with very nice C++ library. Thanks and +1.
  • Jeremy Sandell
    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
    Vortico over 10 years
    While POCO is huge compared to most other C++ libraries, it is dwarfed by Boost's ~100MB package.
  • void-pointer
    void-pointer over 10 years
    The 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
    Dmitry over 10 years
    That'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 (or unix, __unix__, __unix) macro. I'm not sure it would work but you can try to add the option for PLATFORMSTL_OS_IS_UNIX macro in platrofmstl.h: #if defined(unix) || \ defined(UNIX) || \ defined(__unix__) || \ defined(__unix) || \ defined(__MACH__) # define PLATFORMSTL_OS_IS_UNIX
  • void-pointer
    void-pointer over 10 years
    Thanks 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
    ruipacheco over 9 years
    Why are there downloads for each platform? Shouldn't this abstract away each platform's specific features?