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

java.io.File.renameTo fails on a NFS mounted location

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 1.1, 1.2.0, 1.3.0
    • core-libs
    • None
    • generic, x86, sparc
    • solaris_2.6, windows_95



      Name: joT67522 Date: 08/22/97


      This is sample code for a java application. The renameTo method works
      on a local file system. When the renameTo is used to rename a file
      on the local file system to a NFS mounted path it fails. It does
      not throw an exception. This application is running on Solaris.

          final public void Close(){
              if(fevents != null){
                 System.out.println("IN CLOSE " + Filename);
                 try{
                  fevents.close();
                  fevents = null;
                  if(renamefile == true){
                    System.out.println("Rename from " + tempfile);
                    System.out.println("Rename to " + Filename);
                    File tempf = new File(tempfile);
                    File newf = new File(Filename);
                    if(newf.exists() == true)
                      newf.delete();
                    tempf.renameTo(newf);
                    renamefile = false;
                    Filename = null;
                  }

                 }catch(Exception e){
                  System.out.println("Exception Close " + e);
                  exceptionLog("CLOSE",e);
                 }
              }

              if( sourceData != null){
                  try{
                   sourceData.close();
                   sourceData = null;
                  }catch(Exception e){
                   exceptionLog("CLOSE",e);
                  }

              }
          }

      company - Digital Solutions, Inc. , email - ###@###.###
      ======================================================================

            mr Mark Reinhold
            johsunw Joon Oh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: