holepunchto / hyperdrive-next

Hyperdrive is a secure, real-time distributed file system
https://docs.holepunch.to
Apache License 2.0
45 stars 9 forks source link

`drive.readdir` does not return both entry and prefix #32

Open josephmturner opened 1 year ago

josephmturner commented 1 year ago

If a hyperdrive contains a path corresponding to both an entry (file) and a prefix (subdirectory), drive.readdir only returns the entry (file). https://github.com/RangerMauve/hypercore-fetch/issues/46 and https://github.com/RangerMauve/hypercore-fetch/pull/47 discuss this issue.

Per https://github.com/holepunchto/mirror-drive/issues/14, paths can potentially correspond to both an entry and a prefix. Therefore, when such a duplication exists, should drive.readdir return both values?

mafintosh commented 1 year ago

If easy and no perf cost yea sure. Feel free to poke at that