POSIX/Unix stuff, implemented in javascript