First of all, thanks for this extremely useful project!
I would like to have it run in the browser by compiling it to web-assembly using emscripten. Emscripten itself does not currently provide support for std::filesystem and it seems to me this might be in scope for your library.
I was able to have it compile using emscripten by simply adding
#elif defined(__EMSCRIPTEN__)
#define GHC_OS_WEB
to your platform determination part in filesystem.hpp.
It was immediately usable, but the following simple example gives a crash, so I suppose there may be some more effort necessary to get things running correctly:
for(auto& p: fs::recursive_directory_iterator("."))
std::cout << p.path() << '\n';
fails after two prints
./proc
./proc/self
Operation not permitted: './proc/self'
Note that the "filesystem" in this case is the virtual browser filesystem -- I have not yet researched the nuances that might make the browser platform different from others.
First of all, thanks for this extremely useful project!
I would like to have it run in the browser by compiling it to web-assembly using emscripten. Emscripten itself does not currently provide support for
std::filesystemand it seems to me this might be in scope for your library.I was able to have it compile using emscripten by simply adding
to your platform determination part in filesystem.hpp.
It was immediately usable, but the following simple example gives a crash, so I suppose there may be some more effort necessary to get things running correctly:
fails after two prints
Note that the "filesystem" in this case is the virtual browser filesystem -- I have not yet researched the nuances that might make the browser platform different from others.