Please allow search for files in subdirectories.
You could create a GFL_SUB system variable for this
Enhancement - GetFileList - Allow Search in Subdirectories
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 50
- Joined: Fri Jan 20, 2006 10:43 pm
Get file list enhancement
That would be a very nice feature. Currently I get a directory list and then go through each directory with GetFileList
-
- Pro Scripter
- Posts: 50
- Joined: Fri Jan 20, 2006 10:43 pm
Get File List - Directories
If you set GFL_TYPE=1 and use GetFileList>C:\*.*,DIR you get the directories in C:. You do not get a list of the subdirectories.
Similarly, a method of getting a list of all directories including subdirectories would be nice.
Similarly, a method of getting a list of all directories including subdirectories would be nice.
- Marcus Tettmar
- Site Admin
- Posts: 7394
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Get File List - Directories
The directories in C:\ *are* subdirectories. They are subdirectories of C:\sailor dude wrote:If you set GFL_TYPE=1 and use GetFileList>C:\*.*,DIR you get the directories in C:. You do not get a list of the subdirectories.
Similarly, a method of getting a list of all directories including subdirectories would be nice.
If you set GFL_TYPE to 1 you get a list of folders in the folder you specify.
If you want subfolders of subfolders of subfolders ..... then we need to recurse:
Code: Select all
Let>numSubDirs=0
ArrayDim>aSubDirs,numSubDirs
GoSub>getSubDirs,c:\temp
**BREAKPOINT**
ArrayCount>aSubDirs,total_dirs
MessageModal>There are %total_dirs% sub folders
//now look in the watch list at the aSubDirs array which contains entire recursive tree of sub folders
//recursive suroutine to get subfolders ...
SRT>getSubDirs
Let>LOCALVARS=1
Let>GFL_TYPE=1
GetFileList>%getSubDirs_Var_1%\*.*,dirList
Separate>dirList,;,dirs
If>dirs_count>0
Let>k=0
Repeat>k
Let>k=k+1
Let>this_dir=dirs_%k%
Let>LOCALVARS=0
Let>numSubDirs=numSubDirs+1
ArrayDim>aSubDirs,numSubDirs
Let>aSubDirs_%numSubDirs%=this_dir
Let>LOCALVARS=1
GoSub>getSubDirs,this_dir
Until>k=dirs_count
Endif
END>getSubDirs
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?