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
Request: LuaFileSystem for redbean #215
Comments
|
This would be trivial to implement as cosmopolitan libc implements the C API to access the filesystem. You have two possible solutions:
|
|
@username-computer, it's not too difficult to add LFS (for example, see #185 that added lsqlite support), but I think @jart is striving to keep the code small and simple, so the functions in LFS will likely duplicate those already available in cosmopolitan (or those that should/will be available), so it's not likely to be accepted. As @mundusnine described, you should still be able to add it yourself though, if you want to, as it's just one file, so the changes will be very similar to those in #185. Another option is to identify those functions you really need (out of those that LFS provides) and check which ones may already be available in cosmopolitan and which ones may need to be added. For example, lstat, fcntl (lock/unlock), mkdir/rmdir/opendir, chmod/chown, and some other functions are already available, but not exposed to the Lua code, so it may be sufficiently simple to add them. Others like chdir() and currentdir() may not be applicable to redbean. |
|
@username-computer, something like this should work: https://github.com/pkulchenko/cosmopolitan/tree/redbean-lua-lfs. This would include lfs into redbean and allow the code like I'm not proposing to merge this, as I suspect @jart has other ways of implementing the same functionality, but it's available if you need it. |
|
Thank you @pkulchenko. I added Very cool. Thanks. |
I see a lot of potential in redbean. I really keep this project on my radar.
Using the browser as GUI and Lua as the dynamic language in combination with HTML, CSS and Javascript, really flexible.
But at the moment there is something missing, something to see and traverse the computers filesystem.
Lua on itself is lacking in that department, but the cross-platform third-party library LuaFileSystem fixes this.
First I tried building LuaFileSystem so I had a
.sofile and placing it in the/.luadirectory sorequirecould find it. This obviously failed.I have read the closed and open issues and found: using shared libraries #137.
Now I understand that conflicts may arise when using shared libraries in combo with Cosmopolitan.
Still, I think it would be a great addition if somehow the LuaFileSystem library could be included with redbean.
If I could help with some things in relation to this issue, please give me some directions.✌️ 
Thanks and keep up the good work
The text was updated successfully, but these errors were encountered: