Open
Conversation
…ne from org.w3c Added backward compatibility constructor in PlatformFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adding support for a directory picker.
It is still based on the input field with the webkitdirectory attribute:
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#webkitdirectory
https://developer.mozilla.org/en-US/docs/Web/API/File/webkitRelativePath
It is supported on most modern browsers.
Therefore a change in the PlatformFile was necessary. I created an interface.
The current implementation creates virtual directories because the input form returns a list of all files recursively from the user selected directory. Than a virtual tree is build in memory and linked to a virtual root directory.
Moved following PlatformFile extension functions to common:
I am also experimenting with FileSystemAccessApi. Which does allow to support more real access to the host file system. Including write access and also maybe bookmarking of resources (Limited to chromium based browsers).
Other than that it is maybe also possible to support a sandbox filesystem based on thr File System API:
https://developer.mozilla.org/en-US/docs/Web/API/File_System_API
Than web Filekit could also provide this files and cache directory with read/write access.
I think what maybe missing in the PlatformFile is an extension function where you can check if the File/Directory is writeable.
(And also maybe if a file/directory do has read access allowed?)