Closed jvilk closed 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.
I'm currently integrating BrowserFS in the doppio-bfs
branch. Here's what's remaining:
src/testing.coffee
needs to switch over to asynchronous commands.PreloadFile
, which supports this use case.Everything else, though, I believe I have converted. It works quite well. :smile:
Bullet points 1 and 2 taken care of.
<3
Current blocker: BFS doesn't use the correct error codes, and the current hacks mean that we're getting internal errors instead of exceptions.
Oof. Do you know which error codes are actually important? If it's just one or two, we can hack them in for now.
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.
Woo! All tests pass in the browser! I think we're ready to merge.
Merged #238, closing.
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:
41 Integrating ourselves with cloud services will be much simpler, as I believe those APIs are asynchronous. At least, filepicker.io seems to be, although that's a paid service.
Note that I am talking about the filesystem API, and not the Node API.