js-platform/idbfs — pull request #38 by ispedals (2013-11-23 19:56:55+00:00)
Title: Initial Implementation of Symbolic link

This is an initial implementation of symbolic links. This adds `symlink`, `readlink`, `lstat`, the constant `SYMLOOP_MAX`, and the error `Eloop`. This also allows `find_nodes` and `open` to follow symbolic links when they encounters them

`SYMLOOP_MAX`, the number of symbolic links to follow when resolving a symbolic link, has been arbitrarily set to 10. However, I have not added any limit on the total number of symbolic links that may be followed when resolving a path.

I have added tests for functions that act directly on nodes. According to `symlink(7)`: `lstat()`, `readlink()`, `rename()`, `rmdir()`, `link()`, and `unlink()` should not follow symbolic links. `stat()` is tested for following symbolic links.

The remaining functions that act on nodes do so through `open()`, so `open()` is implicitly tested through using `readfile()` and `writefile()`.

This also fixes `unlink_node()` leaking variables into the global scope.