4 ms·
Temp file issue is debunked here: https://news.ycombinator.com/item?id=41684848 https://news.ycombinator.com/item?id=41684848 Dir module works fine, though may
by compumike 2y ago
Temp file issue is debunked here: https://news.ycombinator.com/item?id=41684848 https://news.ycombinator.com/item?id=41684848
Dir module works fine, though maybe the docs could be improved. https://crystal-lang.org/api/1.13.3/Dir.html https://crystal-lang.org/api/1.13.3/Dir.html . The stdlib code is also highly readable: https://github.com/crystal-lang/crystal/blob/d14d04562/src/dir.cr#L111 https://github.com/crystal-lang/crystal/blob/d14d04562/src/d... shows that #each_child just calls #read and yields it to the block, so I don't think this is really a wart :)
- nurettin 2y agoI think the Dir issue wasn't that documentation was inadequate or stdlib code was hard to read, but he expected paths, and received strings instead.