Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-11784

IF EXIST directory does not always work correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 0.4.6
    • Shell
    • None
    • April 2017

    Description

      On windows it is still possible to check if a directory exists in the following way:

      if exist C:\WINDOWS\NUL echo C:\WINDOWS exists and is a directory

      This does not seem to work on ROS (tested r72073).
      (Note that on windows it is not possible to detect a directory this way if the path includes junctions or symbolic links, or if it is quoted).

      The recommended way to test for a directory, is to use a backslash at the end. This works in ROS for directories, but it gives a wrong result for files:

      if exist c:\freeldr.sys\ echo this should fail

      While writing this, I also found out that pagefile.sys cannot be detected on ROS in the following way:

      if exist c:\PAGEFILE.SYS echo PAGEFILE.SYS exists on c:\

      related:

      Attachments

        Issue Links

          Activity

            People

              Heis Spiter Pierre Schweitzer
              wimh wimh
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: