forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


For the people who need it... Recusive directory reading!

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Raymond175
Contributor
Contributor


Joined: 24 Apr 2002
Posts: 72

PostPosted: Sun Jan 25, 2004 1:16 pm    Post subject: For the people who need it... Recusive directory reading! Reply with quote

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
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jan 25, 2004 4:27 pm    Post subject: Reply with quote

I moved your topic to the VDS 3 Source Code Section Smile
EDIT: Moved back to General Help to avoid duplicate post in VDS 3 Source code

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Jan 26, 2004 2:50 am    Post subject: Reply with quote

Very nice. I made command for it. Smile

Code:

#define command,ListGetFiles

:ListGetFiles
#ListGetFiles <Path>,<File Spec (ie. *.mp3)>,<List # (Will be created)>
#  %%Path = G:\~Developer CD~\Src Code
  LIST CREATE, %3
  LIST FILELIST, %3, %1, *DHSR
  %9 = @COUNT(%3)
  %8 = 0
  REPEAT
    IF @GREATER(%9, 0)
      LIST FILELIST, %3, @ITEM(%3)\%2
      LIST DELETE, %3
      %8 = @SUCC(%Cool
    END
  UNTIL @EQUAL(%8, %9)
exit

_________________
Chris
Http://theblindhouse.com


Last edited by LiquidCode on Wed Jan 28, 2004 12:32 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Raymond175
Contributor
Contributor


Joined: 24 Apr 2002
Posts: 72

PostPosted: Mon Jan 26, 2004 11:22 am    Post subject: Reply with quote

Very nice, only I have version 3.51 of VDS, so I cannot use your 'command'... But I have an idea how it works by looking at it, so thanks anyways!

Raymond
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group