Skip to content

Entries: Should directory be defined as a special type of file? #234

Open

Description

@jcayzac

The spec defines file and directory as sibling concepts. A file has binary data and a name. A directory has a name and an ordered list of members, each a file or a directory.

Should directory instead be defined as a special type of file, so that minimal changes are necessary in HTML to describe directory selections made with webkitdirectory and DataTransferItem.webkitGetAsEntry()?

Related:

Activity

  1. self-assigned this
    on Nov 20, 2026
  2. changed the title [-]Should `directory` be defined as a special type of `file`?[/-] [+]Entries: Should `directory` be defined as a special type of `file`?[/+] on Nov 20, 2026
  3. annevk commented on Nov 23, 2026

    @annevk
    Member

    That is what we do in https://fs.spec.whatwg.org/ and so it probably makes sense. But directory selections end up appearing as file selections to HTML, I think. Unless you use an API other than <input type=file>.files perhaps.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions