Allow user to provide a virtual file system #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This would allow any module implimenting:
fs.unlink(path, callback(err))
fs.readdir(path, callback(err, files)
fs.statSync(path)
fs.stat(path, callback(err, s))
fs.mkdir(path, mode = 0755, callback(err))
fs.open(path, flags = 'r', callback(err, fd))
fs.read(fd, 4096, socket.totsize, socket.mode, callback(err, chunk, bytes_read))
fs.close(fd, callback)
fs.open(path, flags = 'w', 0644, callback(err, fd)
fs.write(fd, buf, 0, buf.length, null, writeCallback)
fs.rmdir(path, callback(err))
fs.rename(path, path, callback(err))
to be passed in, regardless of the actual store used on the back end (e.g. AmazonS3, Azure, etc.)
todo: convert to use stat rather than statSync as many virtual file systems may not support syncronous stat operation.
todo: provide user object to store so store can fail based on authorization?
todo: build sample virtual file system implimentation for at least one db type