The first release we had to do on the Open Source class was to implement the du command on Filer. Filer is “a POSIX-like file system interface for node.js and browser-based JavaScript”. You can find the filer project here and the issue we worked on here.
Du is a Unix command that shows the disk space usage for a specific file or directory. There are two manual commands that I used to help me, the GNU one and the Open BSD. You can also find the link for the Apple implementation of the du command .
My mainly thought after doing this first release is: working with open source and programming is hard! Also it is really challenging, in a way that puts you against yourself and makes you want to find the answer no matter what. I am also learning to program in JavaScript what makes really hard to work in something that big. Luckily, I had someone that helped me a lot! Kieran is a classmate that taught me all the proceeds to set up my machine, how to look for a piece of code, how to reuse the code, how to use Git, Github and anything else I had to do in this project.
During the process to write the tests I and Kieran fond that when using the du command on Matrix and on Mac OS, the results were different. I searched about file systems, block usage and how different implementations of the du command works. The implementation from GNU and Open BSD are slightly different, but what makes the results not match is probably the file system and how directories are created and managed by the OS.
The implementation I did can be found here, but it is not complete. I did just the tests and even this is not complete too. That is because I’m taking this course, even tough it’s much forward in the course and I’m not dominating JavaScript. Anyway, it’s being a very good learning for me and I’m getting in touch with all these tools.
The tests I did involve verifying if the du command (working more as the ls -l command) returns the right size of the file when running without a specified path, on a specific file, on and inside an empty directory, on and inside a directory with a single file and on and inside a directory with multiple files.
Hope to be able to finish it by myself soon!
Cheers.