Hacker News new | past | comments | ask | show | jobs | submit login

I don't even have downvote privileges yet!

I was unaware of the getdents issue - thanks. However, it is most definitely slower than ls, because I've only tested it on large directories, rather than using it with large directories daily, so I haven't found places to optimise it quite yet. I'm not sure if using Rust will let me avoid that buffer issue, as right now I'm just using the function provided in its standard library.




You can call the raw system call using, for example, kmc's syscall! macro: https://github.com/kmcallister/syscall.rs

I do wonder if it's worth it eventually for libstd to speak the syscall interface directly, instead of going through another language's standard library (and whatever bugs or design decisions that standard library might have).


Nope, If you are using libc readdir, gettdents issue is unavoidable.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: