Why Nostr? What is Njump?
2025-02-16 09:39:37

Nicolas Martyanoff on Nostr: In Go, os.ReadDir cannot read entries incrementally and calls lstat on each entry. ...

In Go, os.ReadDir cannot read entries incrementally and calls lstat on each entry. Terrible interface if you need to handle arbitrarily large directories. A puzzling choice when POSIX already have the correct API (opendir/readdir_r is incremental and fast).

A tolerable alternative is filepath.WalkDir (Go 1.16+): no more lstat, but it still forces you to read all files in each directory.

Seriously bad design.
Author Public Key
npub1dkg70vzk4vvfsc5cup9gkfu2tcrs5unysl7npfvegf78nkuswr5skh54dt