Skip to content
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

Can fatfs be used with files emulating memory? #32

Closed
tawjaw opened this issue Oct 9, 2020 · 1 comment
Closed

Can fatfs be used with files emulating memory? #32

tawjaw opened this issue Oct 9, 2020 · 1 comment

Comments

@tawjaw
Copy link

tawjaw commented Oct 9, 2020

Hello

I’m wondering if this library can be used to read and write to a file. The goal is for the file to simulate an SD card.

I’d appreciate any tips. Thanks

@natevw
Copy link
Owner

natevw commented Nov 27, 2020

Yes, see the Volume Driver API section of the documentation. The example there with the exports.createDriverSync might work as-is for you — give it a local path to basically a raw "disk image" and it should work.

I think the only caveats are that the file needs to already be a particular size, and should already be formatted. Right now this library doesn't include a method to format a partition but it wouldn't be too hard to add. See the link at #30 (comment) where another project is using this with in-memory buffers; it looks like they've worked out some code of their own to format (which would be a bit simpler if it could use some internal stuff of this library directly).

Hope that helps! I'll close this out as I think you have some pointers to what you need but feel free to re-open and/or post followups in the thread here.

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

No branches or pull requests

2 participants