How to read and write files in NetScape 2.01/Solaris 2.4

Warning:
Please don't do this if you don't know what you're doing. And don't try this at home, kids.

This page assumes that you've installed an empty security manager. Prepare your moz2_01.zip, and restart NetScape before proceeding.

Sal Cataudella pointed out that choosing a different CLASSPATH works as well and doesn't require zipping and unzipping moz2_01.zip.

It contains the following four applets:

dirlist.java lists the current directory.
fileio.java creates a file fileio.test and writes to it.
fileior.java reads the file fileio.test.
delete.java deletes the file fileio.test
On the Java console, you should see a bunch of security exceptions by now.

Here is the complete C-program, nosecure.c. A knowledgeable assembly programmer should have no difficulties porting the program to IRIX, Linux, and Windows.
Download it, and proceed as follows:

> cc -o nosecure nosecure.c 
> ps -fugback | grep netscape
   gback 23178  9425  9 20:13:22 pts/2    0:00 grep netscape
   gback 23132 19140 80 20:06:11 pts/7    0:20 ../netscape http://...
> nosecure 23132
successfully enabled netscape /proc/23132
Now press < Shift > Reload, and look at the Java console. You should see:
Listing of directory .
 < listing of directory excluded >
Opening fileio.test for write access
Opening fileio.test for read access in 3 secs
Deleting fileio.test in 10 secs.
Hello, World
Deleting fileio.test NOW.
Use at your own risk.

- Godmar