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
665 stars 65 forks source link

AccessHandles need a better name #371

Closed tomayac closed 2 years ago

tomayac commented 2 years ago

Currently, a FileSystemFileHandle gives you a FileSystem(Sync)AccessHandle by calling FileSystemFileHandle. create(Sync)AccessHandle(). This means you end up with code like below:

// Before:
const accessHandle = await fileHandle.createSyncAccessHandle();
accessHandle.write(…)

I wonder if maybe we do something else instead: similar to FileSystemFileHandle.getFile(), we could just have FileSystemFileHandle.get(Sync)HighPerformanceFile() or something, which then exposes all the things as listed in the IDL.

// After:
const hiPerfFile = await fileHandle.getSyncHighPerformanceFile();
hiPerfFile.write(…);

This would mean you get a special kind of high performance file object rather than a handle on a handle. It wouldn't be symmetric to File objects, but conceptionally it feels at least a little cleaner to me.

mkruisselbrink commented 2 years ago

Anything related to Access Handles is probably better discussed in https://github.com/whatwg/fs rather than here, as that is where that spec lives, so probably has more of the right people paying attention.

tomayac commented 2 years ago

Closing in favor of https://github.com/whatwg/fs/issues/32.