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

initial draft backend for File System specification with Access Handles #103

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rektide
Copy link

@rektide rektide commented Oct 2, 2022

Start a draft, towards implementing #28.

Currently utterly untested. 🙃

const handle = await dir.getFileHandle(filename)
const file = await handle.getFile()
const mtimeMs = file.lastModified
// NEEDED: https://github.com/whatwg/fs/issues/12
Copy link
Author

Choose a reason for hiding this comment

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

would love to see whatwg/fs#12 for better file metadata so we could support more of this

Comment on lines +237 to +238
// classic File API only, WANTED: https://github.com/whatwg/fs/pull/9
await dir.removeEntry(filename)
Copy link
Author

Choose a reason for hiding this comment

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

there's a PR for SyncAccessHandles to get a remove, whatwg/fs#9.

Comment on lines +293 to +294
async rename(oldFilepath, newFilepath) {
// WANTED: https://github.com/whatwg/fs/pull/10
Copy link
Author

Choose a reason for hiding this comment

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

there's a PR for access handle landing a move, whatwg/fs#10

Comment on lines +324 to +326
async readlink(filepath, opts) {
// NEEDED: https://github.com/whatwg/fs/issues/54
throw new Error("Insufficient web standards for readlink");
Copy link
Author

Choose a reason for hiding this comment

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

would love to see whatwg/fs#54 so we could support link handling (see also symlink below).

Comment on lines +342 to +344
async watch() {
// NEEDED: https://github.com/WICG/file-system-access/issues/72
throw new Error("Insufficient web standards for watch")
Copy link
Author

Choose a reason for hiding this comment

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

would love to see WICG/file-system-access#72 for watches so we could support this.

const handle = await dir.getFileHandle(filename)
const file = await handle.getFile()
const mtimeMs = file.lastModified
// NEEDED: more metadata, https://github.com/whatwg/fs/issues/12
Copy link
Author

Choose a reason for hiding this comment

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

unknown how much further we could get with whatwg/fs#12 but hopefully further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant