Raymond175 Contributor
Joined: 24 Apr 2002 Posts: 72
|
Posted: Sun Jan 25, 2004 1:18 pm Post subject: For the people who need it... Recusive directory reading! |
|
|
I just made a quick program for searching specific types of files on the harddrive. I made it for my MP3-database program.
Code: | TITLE Searching
DIALOG CREATE,Searching,-1,0,250,50,NOTITLE
DIALOG ADD,GROUP,Group,0,4,242,46,Searching for MP3-files...
DIALOG ADD,TEXT,Path,20,12,225,,Loading directory structure...
DIALOG SHOW
%%Path = C:
LIST CREATE, 1
LIST FILELIST, 1, %%Path, *DHSR
%%TotalSubs = @COUNT(1)
%%CurrentSub = 0
REPEAT
IF @GREATER(%%Totalsubs, 0)
DIALOG SET, Path, @ITEM(1)
LIST FILELIST, 1, @ITEM(1)\*.mp3
LIST DELETE, 1
%%CurrentSub = @SUCC(%%CurrentSub)
END
UNTIL @EQUAL(%%CurrentSub, %%TotalSubs)
INFO @COUNT(1) MP3-files found!
LIST SAVEFILE, 1, @PATH(%0)\Filelist.txt
LIST CLOSE, 1
RUN @SHORTNAME(@PATH(%0)\Filelist.txt)
|
You can remove a few lines at the end of the program, but this is only for showing you the output!
Greetz,
Raymond |
|