well js is for client side scripting how do you want to open a file using a client side scripting language when the file is on the server ? you can't except if you start using JScripting for the server side and that's another story.

use a db with php/jsp/asp/cgi ...
a db can be a flat file you don't really need access ...

That should work on most servers. The thing is to write to a new file you will need to use some sort of scripting language, perl, PHP etc. and if you have to use one of those anyway then you might as well do the whole shebang in that language instead of using JS at all.