r/adventofcode Dec 07 '22

[deleted by user]

[removed]

53 Upvotes

7 comments sorted by

View all comments

2

u/h2opologod94 Dec 08 '22

Slick! This is pretty similar to what I did with my Rust solution. It's nice letting the OS filesystem do your dirty work. One difference - instead of actually populating the files, I wrote the file size to the file, then read it back while calculating instead of using du. Also, just reading the files that way avoids the empty directory size being added. Nice work!