learning file operations with js