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 


LIST filelist question [SOLVED]

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


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Mon Jun 06, 2011 9:12 pm    Post subject: LIST filelist question [SOLVED] Reply with quote

Hi,
It's possible retrieve a file list with all files and all subfolder contents? How?

Thamk you


Last edited by Tdk161 on Mon Jun 13, 2011 5:06 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
wolfsoft
Newbie


Joined: 28 Apr 2004
Posts: 2

PostPosted: Wed Jun 08, 2011 10:52 am    Post subject: Re: LIST filelist question Reply with quote

Hi,
this is a small subroutine that creates 2 filelists from a given (%1) directory or drive (ie.: C:\).
List 1 contains all files with relative path.
List 2 contains all files with full path.
%1 is set to the total number of files.

:CreateFilelists
if @null(@file(%1,D))
%1 = 0
exit
end
if @equal(@len(%1),3)
%1 = @substr(%1,1,2)
end
list create,1
list add,1,%1
list filelist,1,%1,*
if @zero(@count(1))
%1 = 0
exit
end
list create,2
%2 = 0
repeat
list seek,1,%2
list filelist,2,@item(1)\*.*
list filelist,2,@item(1)\*.*,SH
%2 = @succ(%2)
until @equal(@count(1),%2)
list clear,1
%2 = 0
%%root = @sum(@len(%1),2)
while @unequal(%2,@count(2))
%%path = @item(2,%2)
%%name = @substr(%%path,%%root,@len(%%path))
list add,1,%%name
%2 = @succ(%2)
wend
%1 = @count(1)
list savefile,1,RelativePath.txt
list savefile,2,FullPath.txt
exit
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Wed Jun 08, 2011 11:22 am    Post subject: Reply with quote

Thank you wolfsoft,

I will try your idea
Back to top
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Thu Jun 09, 2011 3:07 am    Post subject: Reply with quote

The flist function in vdsdll works well....

Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Fri Jun 10, 2011 12:21 am    Post subject: Reply with quote

I solved using the wolfsoft's code Smile

I preferred it because I don't want use an external dll

Thank you to all
Back to top
View user's profile Send private message Send e-mail
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