DirMake vs. DirExist

Started by chrislegarth, May 06, 2019, 08:16:22 AM

Previous topic - Next topic

chrislegarth

I am writing a script that will copy files to several servers.  What I am running into is that the DirMake command gives inaccurate results when a file with the same name exists as the directory I'd like to make.
DirMake reports that the directory is created successfully or in this case already exists.  The DirExist command properly returns that the directory does not exist.  Looks like a bug unless I am missing something.

Just an FYI...Thanks!

ChuckC

The NTFS file system stores names of directory entries[e.g. directories & files] in a case-exact manner, but does lookup/comparison of names in a case-ignore manner.  It is not permissible to have both a directory and a file with the same case-ignore name as siblings together under the same parent directory.  If a file already exists with the same name that you are using when trying to create a directory, that will result in an error.

Use the FileExist() function and DirExist() function together to test for the presence of either a file or a directory with the specified name before calling DirMake().

td

Quote from: chrislegarth on May 06, 2019, 08:16:22 AM
I am writing a script that will copy files to several servers.  What I am running into is that the DirMake command gives inaccurate results when a file with the same name exists as the directory I'd like to make.
DirMake reports that the directory is created successfully or in this case already exists.  The DirExist command properly returns that the directory does not exist.  Looks like a bug unless I am missing something.

Just an FYI...Thanks!

That one has been around for a few years.  It will be addressed in the next release and thanks for reporting the problem.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade