Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6262148

FileOutputStream.open() on a windows device throws FileNotFoundException (win)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.5.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
      Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP Pro Service Pack 2

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      SCSI Tape Device using an Adaptec SCSI 19160-ULTRA 160.
      SCSI Tape Device is a Quantum DLT8000 SCSI Sequential Device

      A DESCRIPTION OF THE PROBLEM :
      When attempting to open a FileOutputStream on a windows device the FileoutputStream throws a FileNotFoundException (The parameter is incorrect). This works for reading the device using a FileInputStream.

      This was also tested on Linux and it works for both FileInputStreams and FileOutputStreams.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      This is broken in windows:
      FileOutputStream out = new FileOutputStream(new File("\\\\.\\Tape0");

      This works in windows:
      FileInputStream in= new FileInputStream(new File("\\\\.\\Tape0");

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I was expecting to get a valid FileOutoutStream that I would be able to write to just like in the Linux Environment.
      ACTUAL -
      java.io.FileNotFoundException: \\.\Tape0 (The parameter is incorrect)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.<init>(Unknown Source)
      at java.io.FileOutputStream.<init>(Unknown Source)
      at com.ice.tar.tar.instanceMain(tar.java:204)
      at com.ice.tar.tar.main(tar.java:151)
      no processing due to errors

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.io.FileNotFoundException: \\.\Tape0 (The parameter is incorrect)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.<init>(Unknown Source)
      at java.io.FileOutputStream.<init>(Unknown Source)
      at com.ice.tar.tar.instanceMain(tar.java:204)
      at com.ice.tar.tar.main(tar.java:151)
      no processing due to errors

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      try {
      outStream = new FileOutputStream( new File("\\\\.\\Tape0") );
      }
      catch ( IOException ex )
      {
      outStream = null;
      ex.printStackTrace( System.err );
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I am working on it.
      ###@###.### 2005-04-27 13:25:48 GMT

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: