plasma-umass / doppio

Breaks the browser language barrier (includes a plugin-free JVM).
http://plasma-umass.github.io/doppio-demo
MIT License
2.17k stars 176 forks source link

Make in-browser filesystem API asynchronous #140

Closed jvilk closed 11 years ago

jvilk commented 11 years ago

While we can make do with a synchronous filesystem API for now, it would be beneficial to switch over to an asynchronous API.

The benefits are as follows:

Note that I am talking about the filesystem API, and not the Node API.

jvilk commented 11 years ago

This has become my next task. By doing this change, I plan to fix:

The filesystem will become a straightforward Unix-style filesystem. The root will be completely in-memory, with file providers such as localStorage, indexedDB, cloud providers, temporary storage, and the webserver mounted somewhere in the in-memory hierarchy.

There will be no more complex 'composed' file sources that cause headaches and issues.

Eventually, once this transformation is complete and stable, I plan to break it away from Doppio into its own repository, as it will be useful in its own right. Perhaps I will also implement other asynchronous Node filesystem functions.

jvilk commented 11 years ago

I'm currently integrating BrowserFS in the doppio-bfs branch. Here's what's remaining:

Everything else, though, I believe I have converted. It works quite well. :smile:

perimosocordiae commented 11 years ago

Bullet points 1 and 2 taken care of.

jvilk commented 11 years ago

<3

perimosocordiae commented 11 years ago

Current blocker: BFS doesn't use the correct error codes, and the current hacks mean that we're getting internal errors instead of exceptions.

jvilk commented 11 years ago

Oof. Do you know which error codes are actually important? If it's just one or two, we can hack them in for now.

perimosocordiae commented 11 years ago

Looks like it's just ENOENT, for now at least. See the above commit.

The hackfix gets us to the point where we're trying to create files in the /sys readonly mount. We'll need to modify our tests to get them working again.

perimosocordiae commented 11 years ago

Woo! All tests pass in the browser! I think we're ready to merge.

perimosocordiae commented 11 years ago

Merged #238, closing.