-
Notifications
You must be signed in to change notification settings - Fork 19
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
Make explicit that FileSystemHandle entries map to paths #30
Conversation
@@ -111,8 +111,9 @@ is left up to individual user-agent implementations. | |||
An [=/entry=] |a| is <dfn for="entry">the same as</dfn> an [=/entry=] |b| if |a| is equal to |b|, or | |||
if |a| and |b| are backed by the same file or directory on the local file system. | |||
|
|||
Issue: TODO: Explain better how entries map to files on disk (multiple entries can map to the same file or | |||
directory on disk but an entry doesn't have to map to any file on disk). | |||
An [=/entry=] maps roughly to a path, but there is no guarantee this path exists on disk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkruisselbrink do you have a suggestion for a better way to word this?
I'm still hedging with the use of "roughly" here. I'm not sure how to toe the line in being as explicit as we can about what exactly the entry is, while allowing for entries to point to places other than disk (Drive, etc)
So we already state that entries have a name, but it seems that isn't the full location. Can we give entries an additional field, called "path" or "location" that is a string or byte sequence or implementation-defined type representing a location on disk? And then we build the other things on top of that. I typically find that making the conceptual model explicit in terms of data structures makes it easy to build processing models on top. |
We've had a number of requests to expose the full path on the non-standardized portion of the API (WICG/file-system-access#178, for example), but for privacy reasons I don't see us ever exposing a path for handles outside of the OPFS. That being said, I don't think a full location is something we'd want or need to expose within the OPFS, either. A relative path is already available by calling There's also the question of how this path would interact with Buckets. For example, multiple handles could have the same path but still be distinct files because they're in different buckets (unless the path includes the bucket somehow, which is a can of worms I assume we don't want to open). The advantage of using On that note, I'm open to renaming |
#14 is somewhat related |
I'm saying that we add it as a (private) member to the "entry" concept. Not that we'd expose it through a public API. |
Ah I see. I did not realize we could spec a private member.
It sounds like this member SHOULD include the bucket information. Assuming every new bucket has a unique ID (which seems like something we could spec?), this would handle the "clear site data" case above (or future "clear bucket" mechanism), since it would guarantee that handles become invalidated (well, at least always return Should we prefer "location" to "path", since this generalizes better to things like in-memory file systems and makes it clear that this is not a path relative to a bucket, but a location identifier which should include bucket information? Overall this seems reasonable to me as long as we're okay with the implications for |
A much more thorough (than #30) attempt at expressing that FileSystemHandle maps to a file path. At a high level, it proposes that: * A FileSystemHandle has an associated "file system locator" * A "file system locator" contains, among other things, a "file system path" * A "file system entry" can be located given a "file system locator" * You can get a "file system locator" from a "file system entry" See #59 for the implications of this in practice. Fixes #59.
Be more explicit in describing how FileSystemHandles map to a path on disk, and the implications of this choice. Consider the following cases:
Clearing site data
Moving a file handle (see #10)
Removing a file handle (see #9)
Preview | Diff