You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common pattern when a known file structure is known ahead of time is to ask the user to select a well known file in the file structure and use that to obtain the directory.
This is to provide a level of validation so the user doesn't select a folder that won't match the correct file structure and used a lot in mod managers.
Example, there is some executable file MyGame.exe and you want to add files to the same folder, rather than having a directory picker and the user potentially picking any folder, they have a filepicker instead that only accepts MyGame.exe as input.
The text was updated successfully, but these errors were encountered:
I can call the showOpenFilePicker() method with a FileSystemFileHandle in the "startIn" parameter - the dialog starts in the directory of the file (in which the file resides).
There is getFileHandle() method (fileHandle = await directoryHandle . getFileHandle(name)) with which the caller can get back a FileSystemFileHandle to a file by name in the given directory.
And there is a getDirectoryHandle() method (subdirHandle = await directoryHandle . getDirectoryHandle(name)) which returns a handle for a directory by name in the directory represented by directoryHandle.
Feature request: directoryHandle = await fileHandle . getDirectoryHandle()
A method which returns a FileSystemDirectoryHandle which points to the directory in which the file resides...
The workaround mentioned above of using startIn parameter might work for this use case. If the goal is to get the parent directory given a file handle, whatwg/fs#38 discusses a similar feature request.
A common pattern when a known file structure is known ahead of time is to ask the user to select a well known file in the file structure and use that to obtain the directory.
This is to provide a level of validation so the user doesn't select a folder that won't match the correct file structure and used a lot in mod managers.
Example, there is some executable file
MyGame.exe
and you want to add files to the same folder, rather than having a directory picker and the user potentially picking any folder, they have a filepicker instead that only acceptsMyGame.exe
as input.The text was updated successfully, but these errors were encountered: