-
Notifications
You must be signed in to change notification settings - Fork 197
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
mount local folder using files api ( recent browser ). #68
Comments
If you go to work on this, perhaps you should consider writing it as a separate client-side npm module which translates 9p to the files API? |
I'm a bit confused by the npm reference? I was thinking everything in browser ? |
I was under the wrong assumption that the files apis was also able to write, |
trabitboy, you are not the first who is suggesting it. It is possible and would be a nice feature. However when I read the red boxes on the websites like my motivation drops to zero implementing it. With "some browsers" you mean basically Chrome. A implementation on the server side is of course possible. Actually my "cloud" backup button is already a tiny step in this direction. |
Well actually I also have access to an old-ish chrome in this restricted environment, and I don't mind to investigate. |
You are free to do so. POSIX filesystems are not complicated. However, to support the current filesystem API, you have to modificate a lot of the current implementation. It begins with a message based interface to the main thread, because I think, that the filesystem API doesn't work in a worker thread. |
Trying to look into "hacking" a hardcoded fs in the existing implementation to begin with; I can run the "simple" demo locally in my browser, but I can't see or breakpoint the dynamically loaded js in either firefox or chrom or get easily debug messages from the worker thread. |
For debug messages I use the following code To stop the current emlation you can use the message.Abort() function |
I was just suggesting writing an npm module because there's likely bits that are reusable. You can use npm as a package manager for client side code w/ request.js or browserify. If you want to keep everything nice and modular and well encapsulated, you'll likely be writing a chunk of code which converts 9p messages to JS function calls, and then a separate module which registers a bunch of functions with that one, so that the 9p messages actually translate to something useful. The "9p to JS events" bit is ripe for being written as a reusable npm module. This could help @copy for instance, to reuse this code (should he want to). |
Hi, I've been testing chrome local file api, but you can only write to a sand box, which I can't seem to find the location of, so usefulness is not very high ... |
Uploading a file and downloading a tar.gz is cool,
but being able to mount a local directory would be interesting .
On browsers supporting the files api, it is technically possible.
I have no idea how to program a linux fs from scratch, but as jor1k already has a js based filesystem,
probably changing its backend to target files api doesn't seem too far fetched ?
motivated
The text was updated successfully, but these errors were encountered: