API Ergonomics: Pointer to associated FileSystemFileHandle
from FileSystemSyncAccessHandle
?
#99
Labels
addition/proposal
New features or enhancements
needs implementer interest
Moving the issue forward requires implementers to express interest
For getting a
FileSystemSyncAccessHandle
, you need aFileSystemFileHandle
first, which, in a Worker, where you want to work with the all-sync file methods, you generally don't have much use for, so you could "skip" it as below:If, however, you decide at some point wanting to transfer the file from the OPFS over to the user-visible file system, you now need to
postMessage()
aFileSystemFileHandle
in order to let the user runshowSaveFilePicker()
over on the main thread, where you can thenwrite()
theFile
you obtain viagetFile()
.Would it make sense to add a
FileSystemSyncAccessHandle.fileHandle
property, that would point at the associatedFileSystemFileHandle
? This would enable the following flow:(The alternative would be to just keep a reference around to the
FileSystemFileHandle
in the Worker until it's needed. It's really mostly a potential ergonomics improvement. Thoughts?)The text was updated successfully, but these errors were encountered: