Getfilelist question
Moderators: JRL, Dorian (MJT support)
Getfilelist question
Does the Getfilelist command support the command switches that are available to the DOS dir command? Such as attributes? I have a script that processes files in a folder and it appears that it reads the name before the file is completely created. I could rewrite the script to use the DOS Directory command to create a text file and process the text file; however, if the Getfilelist command supports the switches it would be easier.
kpassaur,
As far as I know, GetFileList does not support anything like the DOS command line switches that you can use with the DIR command. GetFileList also does not provide directory names. However, using the following code, you can circumvent this minor deficiency. It sounds like you already know what to do you're just trying to find an easier way. I don't think there is one.
//delete these files first in case they got left behind previously
DeleteFile>batfile.bat
DeleteFile>tempfile
Writeln>batfile.bat,result,dir c:\path\*.* [appropriate switches] > tempfile
Let>RP_WAIT=1
Let>RP_WINDOWMODE=2
Run Program>batfile.bat
DeleteFile>batfile.bat
Let>k=0
Label>startread
Let>k=k+1
Readln>tempfile,k,line
If>line=,startread
If>line=##EOF##,endread
If>line=##NOFILE##,endread
//Process variable line
goto>startread
Label>endread
DeleteFile>tempfile
//On with the show....
Hope this helps,
Dick
==================================================================================
---------------------------------------------------------------------------------------------------------------------
==================================================================================
TopicQty:;7TopicQty:;
Special characters work except for @. Use (at) if you want an @ character.
Topic1:; Code Sample Topic1:;
Topic2:; Song Lyric Topic2:;
Topic3:; Useful Information Topic3:;
Topic4:; Best Practice Topic4:;
Topic5:; Useful Information Topic5:;
Topic6:; Useful Information Topic6:;
Topic7:; Useful Information Topic7:;
Text1:; LET>HAPPY HOLIDAYS=365 DAYS OF THE YEAR Text1:;
Text2:; THERE WILL BE AN ANSWER LET>IT=B Text2:;
Text3:; PROGRAMMER / USER CONVERSATIONS ARE CALLED DIALOGS Text3:;
Text4:; USE MULTICHARACTER VARIABLES WHENEVER POSSIBLE TO PREVENT ERRORS Text4:;
Text5:; BEST HELP ON THE INTERNET? MACRO SCHEDULER FORUM Text5:;
Text6:; MOST VALUABLE TOOLS? THE INTERNET AND MACRO SCHEDULER Text6:;
Text7:; MACRO SCHEDULER, AUTOMATING PROCESSES BEFORE RPA WAS INVENTED Text7:;
As far as I know, GetFileList does not support anything like the DOS command line switches that you can use with the DIR command. GetFileList also does not provide directory names. However, using the following code, you can circumvent this minor deficiency. It sounds like you already know what to do you're just trying to find an easier way. I don't think there is one.
//delete these files first in case they got left behind previously
DeleteFile>batfile.bat
DeleteFile>tempfile
Writeln>batfile.bat,result,dir c:\path\*.* [appropriate switches] > tempfile
Let>RP_WAIT=1
Let>RP_WINDOWMODE=2
Run Program>batfile.bat
DeleteFile>batfile.bat
Let>k=0
Label>startread
Let>k=k+1
Readln>tempfile,k,line
If>line=,startread
If>line=##EOF##,endread
If>line=##NOFILE##,endread
//Process variable line
goto>startread
Label>endread
DeleteFile>tempfile
//On with the show....
Hope this helps,
Dick
==================================================================================
---------------------------------------------------------------------------------------------------------------------
==================================================================================
TopicQty:;7TopicQty:;
Special characters work except for @. Use (at) if you want an @ character.
Topic1:; Code Sample Topic1:;
Topic2:; Song Lyric Topic2:;
Topic3:; Useful Information Topic3:;
Topic4:; Best Practice Topic4:;
Topic5:; Useful Information Topic5:;
Topic6:; Useful Information Topic6:;
Topic7:; Useful Information Topic7:;
Text1:; LET>HAPPY HOLIDAYS=365 DAYS OF THE YEAR Text1:;
Text2:; THERE WILL BE AN ANSWER LET>IT=B Text2:;
Text3:; PROGRAMMER / USER CONVERSATIONS ARE CALLED DIALOGS Text3:;
Text4:; USE MULTICHARACTER VARIABLES WHENEVER POSSIBLE TO PREVENT ERRORS Text4:;
Text5:; BEST HELP ON THE INTERNET? MACRO SCHEDULER FORUM Text5:;
Text6:; MOST VALUABLE TOOLS? THE INTERNET AND MACRO SCHEDULER Text6:;
Text7:; MACRO SCHEDULER, AUTOMATING PROCESSES BEFORE RPA WAS INVENTED Text7:;