Add a FileSystemHandle.create()
method to create self
#126
Labels
addition/proposal
New features or enhancements
needs concrete proposal
Moving the issue forward requires someone to figure out a detailed plan
This idea has been discussed previously by both myself (#39 (comment)) and @szewai (#59 (comment))
#96 clarified that a
FileSystemHandle
maps to a file path - and therefore if the underlying file is removed, theFileSystemHandle
itself is not changed (clarifying #39). Given the recent (though #9 is still blocked) addition of aremove()
method (to remove self), it seems reasonable to allow "create self"Currently, "create self" is possible on Chromium browsers via the
createWritable()
method due to an implementation quirk. See #125 for more details. An explicitcreate()
method would allow for more common-sense behavior of thecreateWritable()
method without removing a capability (i.e. "create self" - specifically when the parent directory is not accessible) that some use cases may rely on.The specific shape of this API still needs more thought (e.g. it would be nice if this could play nicely with an
exists()
method, as proposed in #80, such that the "create if not exists" use case is less vulnerable to TOCTOU errors) but putting this out there in case anyone has comments or wants to put forward a proposal :)The text was updated successfully, but these errors were encountered: