Skip to content

d_type/dirEntType only exposed in Internals? #345

@sjshuck

Description

@sjshuck

The only module that exposes struct dirent { ...; unsigned char d_type; ... } is an internal one. Reason I'm interested is, recursive walking of filesystems in Haskell are slow compared to Python's os.walk(). Haskell ignores the d_type and then does one or more separate system call per file to determine whether it's a file or directory. Example

I might want to work on this, but I don't know between unix, streaming-common, and conduit which is the right place to begin. It's not really a technical question—I could do it from anywhere—I just want to know if this has been attempted before, and if so, what issues were encountered.

It looks like there's not a sum type in existence for d_type values corresponding to https://github.com/bminor/musl/blob/86373b4999bfd9a9379bc4a3ca877b1c80a2a340/include/dirent.h#L51-L59 or glibc's equivalent. I'd say there should be, but it would clash conceptually with this.

What are some thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions