Writing to a tape device in Windows

A

Alan

I can read from a tape device using a FileInputStream as follows:

FileInputStream in = new FileInputStream(new File("\\.\Tape0"));
// followed by standard stream reading stuff

Under Linux, I can write to that device as follows:

FileOutputStream out = new FileOutputStream(new File("\\.\Tape0");
// followed by the standard stream writing stuff

However, under Windows, the FileOutputStream code above fails with an
IOException in the FileOutputStream.open() method, and a message saying
that "the parameter is incorrect".

The same problem occurs in the Windows JDK versions 1.3x, 1.4x, and
1.5x. Is this a known bug in the Java VM? Or is my approach wrong?

Thanks!
 
A

Alan

Note, under Linux, the string was of the form "/dev/..." .

Under Windows the string should be: "\\\\.\\Tape0"

I had this value correct when the exception occurred...
 
A

Alan

Alan said:
I can read from a tape device using a FileInputStream as follows:

FileInputStream in = new FileInputStream(new File("\\.\Tape0"));
// followed by standard stream reading stuff

Under Linux, I can write to that device as follows:

FileOutputStream out = new FileOutputStream(new File("\\.\Tape0");
// followed by the standard stream writing stuff

However, under Windows, the FileOutputStream code above fails with an
IOException in the FileOutputStream.open() method, and a message saying
that "the parameter is incorrect".

The same problem occurs in the Windows JDK versions 1.3x, 1.4x, and
1.5x. Is this a known bug in the Java VM? Or is my approach wrong?

Sun has confirmed that this is a bug in their code. No ETA on when it
will be fixed...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top