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

java.io.FileReader/Writer work incorrectly with NFS-mounted files (win32)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.2.2, 1.3.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      solaris_2.5.1, windows_nt

      Description



      Name: akC57697 Date: 06/02/99



         Java io incorrectly works with files on mapped disks
      For example , using SUNWNFS file system (provided by Solstice
      NFS client).


      The example:
      -----------------------------------------------------------------------
      public class Test {
          public static void main(String[] argv) {
              try {
                  char data[] = { '0', '1', '2', '3', '4', '5' };
                  char empty[] = { };

                  java.io.FileWriter f = new java.io.FileWriter("tempfile");
                  f.write(data);
                  f.close();

                  java.io.FileReader fr = new java.io.FileReader("tempfile");
                  System.out.println("The number of bytes read 1:" + fr.read(data));
                  fr.close();


                  f = new java.io.FileWriter("tempfile");
                  f.write(empty); // Nothing
                  f.close();

                  fr = new java.io.FileReader("tempfile");
                  System.out.println("The number of bytes read 2:" + fr.read(data));
                  fr.close();

              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
      -----------------------------------------------------------------------
      Output :
      The number of bytes read 1:6
      The number of bytes read 2:6

      expected (if use local disk):

      The number of bytes read 1:6
      The number of bytes read 2:-1

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mmcclosksunw Michael Mccloskey (Inactive)
              Reporter:
              akuzminorcl Alexander Kuzmin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: