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

AccessHandles need a better name #32

Open
tomayac opened this issue Jun 2, 2022 · 3 comments
Open

AccessHandles need a better name #32

tomayac opened this issue Jun 2, 2022 · 3 comments

Comments

@tomayac
Copy link
Contributor

tomayac commented Jun 2, 2022

(Migrated from WICG/file-system-access#371.)

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.

@morsssss
Copy link

morsssss commented Jun 2, 2022

In addition - we simply need a more descriptive and easily disambiguated name for the API than "File System Access Handles API".

I fear that developers will have a hard time discovering the File System Access Handles API as it's currently named, and people will struggle to differentiate it from File System Access.

What's special about the new API is that it allows low-level access to files with a POSIX-like interface. Developers can build all sorts of things on top, including database implementations.

@a-sully, Ayu, @tomayac and I have been throwing around ideas with others, but nothing seems quite right. Something about fundamentals? File basics? Buffers or streams seem tempting, but we're not always dealing with actual buffers or streams.

@jsejcksn
Copy link

...have been throwing around ideas with others, but nothing seems quite right. Something about fundamentals? File basics?

Here are some other contextually-relevant synonyms:

  • base
  • core
  • essential

e.g. CoreFile(Handle)

Buffers or streams seem tempting, but we're not always dealing with actual buffers or streams.

But it is always binary data, right? The linked IDL lists properties and methods that deal with byte-oriented data.

e.g. FileBytes(Handle)

@morsssss
Copy link

Thanks for the ideas! "Core" draws me in. As does "bytes". Because this API allows you to deal with bytes directly.

People once batted around the phrase "Native I/O" here, and a couple of people have mentioned that "I/O" seems to also evoke the basic functionality of reading and writing bytes.

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

No branches or pull requests

3 participants