WICG / file-system-access

Expose the file system on the user’s device, so Web apps can interoperate with the user’s native applications.
https://wicg.github.io/file-system-access/
Other
669 stars 66 forks source link

Add FileSystemHandle::remove() method #283

Closed a-sully closed 2 years ago

a-sully commented 3 years ago

Adds the ability for a file or directory to delete itself.

Currently, it is not possible to remove a file or directory given its handle. You must obtain the handle of the parent directory and call FileSystemDirectoryHandle::RemoveEntry.

This would enable the common use case where you obtain a file handle from showSaveFilePicker, but then decide you don't want to save after all, and delete the file.

Fixes #214


Preview | Diff

a-sully commented 3 years ago

@mkruisselbrink PTAL? Particularly at the algorithm portion. Also let me know if you have more details I should add to the description. Thanks!

annevk commented 2 years ago

If this method is still desirable (I don't remember discussing it, but it looks reasonable), could you please port this PR to https://github.com/whatwg/fs?

a-sully commented 2 years ago

This issue has been ported to the new spec: https://github.com/whatwg/fs/pull/9