Skip to content

Allow user to provide a virtual file system #5

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow user to provide a virtual file system #5

wants to merge 1 commit into from

Conversation

ForbesLindesay
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant