Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require an exclusive lock in removeEntry() #73

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ The <dfn method for=FileSystemDirectoryHandle>removeEntry(|name|, |options|)</df
1. If |access| is not "{{PermissionState/granted}}",
reject |result| with a {{NotAllowedError}} and abort.

1. Let |lockResult| be the result of [=file entry/lock/take|taking a lock=]
with "`exclusive`" on |entry|.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we need to ensure that the new locking paradigm covers locked directories appropriately - we should not be able to remove a directory if any contained files are locked, but presumably moving a directory with contained files that are locked is okay

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #137

1. If |lockResult| is false, [=reject=] |result| with a
"{{NoModificationAllowedError}}" {{DOMException}} and abort.

1. [=set/For each=] |child| of |entry|'s [=directory entry/children=]:
1. If |child|'s [=entry/name=] equals |name|:
1. If |child| is a [=directory entry=]:
Expand Down