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

File.isFile() should return "false" for "con" on windows platform

XMLWordPrintable

    • b73
    • generic
    • generic
    • Verified

        There seems strange behavior of isFile() in File class for special device files.

        REPRODUCE :
          (1) Compile the attached program
          (2) Launch java command as follows on each platform
             1) Solaris and Linux
                    Launch "java FiieCheck /dev/console"
             2) Windows
                    Launch "java FileCheck con"
           
        RESULT :
            In (2) 1), the test program returns "false", but in(2) 2), returns true.

        REQUESTs :
           "con" represents console on windows
           but done as normal file.
           That should be treated as special file as on Solaris/linux.

        CONFIGURATION :
           JRE :
             java version "1.5.0"
             Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
             Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)
           Platform :
               - WindowsXP SP1(japanese )
               - RedHatlinux 9.0(japanese)
               - Solaris 8(japanese)
        ###@###.### 10/8/04 07:54 GMT
        ###@###.### 10/15/04 01:22 GMT

              sherman Xueming Shen
              tbaba Tadayuki Baba (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: