-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web platform support using emscripten #68
Comments
Never tried to build and use it using emscripten, but a permission error during recursive iteration is perfectly possible on any of the supported platforms, depending on the rights. Did you try: for(auto& p: fs::recursive_directory_iterator(".", fs::directory_options::skip_permission_denied))
std::cout << p.path() << '\n'; |
Strange, but it gives the same result on my test setup. I haven't figured out yet how to run emscripten-compiled unit tests inside a headless browser and get the output back (i.e. to run them in CI). If that were to work, one could use your tests in CI to determine where any web-specific changes might be needed. |
I gave it a quick try to build the tests with emscripten and there are quite some issues, as not all features are supported (hard links are one example) so some of the tests need to be disabled for support, and some need investigation. Explicitly running the I added that code fragment to the test and get the same |
I found some situation where the condition of permission error comes later in the loop, and that might be something that can hit other platforms too. Sadly the error code returned by the emscripten environment is Looks like I need input from someone more into emscripten. |
Okay, actually that last comment was my fault. So I was able to hot-fix this locally and get
on my system, without an error. I'm currently on my way into office, so I can't work on the real fix until this evening. The commit will only fix the iteration issue ignoring the |
Work on experimental support for use with emscripten is taking place on branch |
…eturns space for the virtual fs even for unexisting paths
Changes released with v1.3.4 |
Awesome 👍 thanks! |
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
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.
The text was updated successfully, but these errors were encountered: