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

Support files with unknown file size #241

Closed
raymeskhoury opened this issue Oct 21, 2020 · 2 comments
Closed

Support files with unknown file size #241

raymeskhoury opened this issue Oct 21, 2020 · 2 comments

Comments

@raymeskhoury
Copy link

Some filesystems (e.g. those exposed using the Android DocumentsProvider API) allow files that have an unknown size. One use case here is when a file is generated when accessed. For example, an online drawing app has an internal representation of the user's images. It can expose a virtual filesystem of .png files for each drawing. However these png's will actually be generated at the time the file is accessed and so the size isn't known ahead of time (e.g. when listing the files).

The current file APIs require a size ahead of time and don't provide a constant to specify an unknown size. This would be something nice to add.

@mkruisselbrink

@mgiuca
Copy link
Member

mgiuca commented Jan 13, 2021

I think this is a dupe of #101 -- but highlighting the core requirement of the proposed getMetadata API that it needs to allow the implementation to return null fields (in this case, return a null file size) so that we can return as much metadata as possible without fetching the entire file, which in the DocumentsProvider case, is the only way to get the file size.

@a-sully
Copy link
Collaborator

a-sully commented Jan 9, 2023

#101 has since been ported to whatwg/fs#12. Your point is noted - we'll keep this use case in mind on that issue

@a-sully a-sully closed this as completed Jan 9, 2023
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

3 participants