GetFileList ALWAYS returns atleast one file as result

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Cepper
Newbie
Posts: 4
Joined: Thu Jul 21, 2005 7:09 am
Location: Copenhagen

GetFileList ALWAYS returns atleast one file as result

Post by Cepper » Mon Jul 25, 2005 10:20 am

Hi

Maybe I have misunderstod something but shouldn't GetFileList return an empty string is no files found??
LET>result=
LET>acms_source=C:\Temp\

IFDIREXISTS>%acms_source%,CheckForFiles,DirNotExists

LABEL>CheckForFiles
LET>DirSpec=%acms_source%ThisFileDoNotExists.*
GETFILELIST>%DirSpec%,filename

IF>filename=,NoFilesInDir,SeparateFiles
LABEL>SeparateFiles
SEPARAT>filename,;,Filenames

LABEL>FilesInDir
LET>Result=Dir %acms_source% holds %filenames_count% files
GOTO>End

LABEL>NoFilesInDir
LET>Result=Dir %acms_source% does not hold any files
GOTO>End

LABEL>DirNotExists
LET>Result=Dir %acms_source% does not exists
GOTO>End

LABEL>End
MESSAGEMODAL>%Result%
The above test gives the following result: Dir C:\Temp\ holds 1 files


The variable filename is given the value:C:\Temp\ThisFileDoNotExists.

Can anybody help??
/Carsten Stiller

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Jul 25, 2005 10:56 am

Ensure you are running the latest version:

http://www.mjtnet.com/index.htm?page=mswhatsnew.html
Version 7.3 28/10/2004
"Fixed GetFileList returning erroneous result when no files match"
MJT Net Support
[email protected]

Cepper
Newbie
Posts: 4
Joined: Thu Jul 21, 2005 7:09 am
Location: Copenhagen

Thanks - The version is the problem

Post by Cepper » Mon Jul 25, 2005 11:26 am

Hi

Thank you for the answer
Not that I can use it right now but it explained my problem

I am running ver. 7.2.050
Will getting funds to upgrade this version

Thanks again
/Carsten Stilller

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts