PSA: FileSystemReadWriteOptions to become optional on Access Handles

45 views
Skip to first unread message

Emanuel Krivoy

unread,
Jul 20, 2022, 8:22:50 AM7/20/22
to blink-dev, asu...@chromium.org

Hello blink-dev,

We’d like to do a small web-facing change to the options parameter of FileSystemSyncAccessHandle read/write methods, making it optional. The change simplifies the surface, is backwards compatible, and is already part of the draft spec/has been positively received by other browsers (see meeting minutes, 6th point).

Example code showing the change:

```

const handle = await fileHandle.createSyncAccessHandle();

const writeBuffer = new Uint8Array([0, 1, 2, 3]);


// Previously:

// Writing at the start of a file

const writtenBytes = handle.write(writeBuffer, {at: 0});


// Writing in the middle of a file

const writtenBytes = handle.write(writeBuffer, {at: 15});



// After the change:

// Writing at the start of a file

const writtenBytes = handle.write(writeBuffer);


// Writing in the middle of a file

const writtenBytes = handle.write(writeBuffer, {at: 15});


```


Thanks,
Emanuel

Reply all
Reply to author
Forward
0 new messages