Incorrect support data (ex. Chrome says "86" but support was added in "40")
What information was incorrect, unhelpful, or incomplete?
The following sequence works perfectly according to the spec in Chrome-108: In safari the following are the deviations from the compatibility guide.
const fileSize = accessHandle.getSize() always return 0
const readSize = accessHandle.read(readBuffer, { "at": 0 }); always returns 0s
accessHandle.write(writeBuffer, { "at" : 0 }); Not sure whether this writes anything
What browsers does this problem apply to, if applicable?
Safari
What did you expect to see?
The snippet described below works fine in Chrome-108. Expect the same from Safari 15.2 as claimed in the doc
Did you test this? If so, how?
The following sequence works perfectly according to the spec in Chrome-108:
const fileHandle = await gFsRoot.getFileHandle("f1.txt"); const accessHandle = await fileHandle.createSyncAccessHandle(); const fileSize = accessHandle.getSize(); const readBuffer = new DataView(new ArrayBuffer(fileSize)); const readSize = accessHandle.read(readBuffer, { "at": 0 }); accessHandle.close();
In Safari 15.2, MacOS Monterey the following are the deviations from what is claimed in the compatibility report:
accessHandle.getSize() returns a Promise is not a sync interface like in Chrome-108. Even if we wait for the reolution using await, the above always returns 0.
Even if we pass the correct fileSize (based on what we wrote), accessHandle.read() always returns 0s.
Not sure whether the following snippet actually writes the file in Safari (chrome-108 works fine). I do not see any errors and it fails silently in Safari probably.
gFsRoot = await navigator.storage.getDirectory(); const fileHandle = await gFsRoot.getFileHandle("f1.txt", { "create" : true }); const accessHandle = await fileHandle.createSyncAccessHandle(); const encoder = new TextEncoder(); const writeBuffer = encoder.encode("Thank you for reading this."); accessHandle.write(writeBuffer, { "at" : 0 }); accessHandle.flush();
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
What type of issue is this?
Incorrect support data (ex. Chrome says "86" but support was added in "40")
What information was incorrect, unhelpful, or incomplete?
The following sequence works perfectly according to the spec in Chrome-108: In safari the following are the deviations from the compatibility guide.
const fileSize = accessHandle.getSize()
always return 0const readSize = accessHandle.read(readBuffer, { "at": 0 });
always returns 0saccessHandle.write(writeBuffer, { "at" : 0 });
Not sure whether this writes anythingWhat browsers does this problem apply to, if applicable?
Safari
What did you expect to see?
The snippet described below works fine in Chrome-108. Expect the same from Safari 15.2 as claimed in the doc
Did you test this? If so, how?
The following sequence works perfectly according to the spec in Chrome-108:
const fileHandle = await gFsRoot.getFileHandle("f1.txt"); const accessHandle = await fileHandle.createSyncAccessHandle(); const fileSize = accessHandle.getSize(); const readBuffer = new DataView(new ArrayBuffer(fileSize)); const readSize = accessHandle.read(readBuffer, { "at": 0 }); accessHandle.close();
In Safari 15.2, MacOS Monterey the following are the deviations from what is claimed in the compatibility report:accessHandle.getSize()
returns a Promise is not a sync interface like in Chrome-108. Even if we wait for the reolution using await, the above always returns 0.accessHandle.read()
always returns 0s.gFsRoot = await navigator.storage.getDirectory(); const fileHandle = await gFsRoot.getFileHandle("f1.txt", { "create" : true }); const accessHandle = await fileHandle.createSyncAccessHandle(); const encoder = new TextEncoder(); const writeBuffer = encoder.encode("Thank you for reading this."); accessHandle.write(writeBuffer, { "at" : 0 }); accessHandle.flush();
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API#browser_compatibility
webkit bug: https://bugs.webkit.org/show_bug.cgi?id=247071 discussion: https://github.com/whatwg/fs/pull/55
Do you have anything more you want to share?
No response
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
MDN metadata
MDN page report details
* Query: `api.FileSystemFileHandle` * Report started: 2023-01-03T02:55:18.611Z