| View previous topic :: View next topic |
| Author |
Message |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Mon Jun 06, 2011 9:12 pm Post subject: LIST filelist question [SOLVED] |
|
|
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 |
|
 |
wolfsoft Newbie
Joined: 28 Apr 2004 Posts: 2
|
Posted: Wed Jun 08, 2011 10:52 am Post subject: Re: LIST filelist question |
|
|
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 |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Wed Jun 08, 2011 11:22 am Post subject: |
|
|
Thank you wolfsoft,
I will try your idea |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Thu Jun 09, 2011 3:07 am Post subject: |
|
|
The flist function in vdsdll works well....
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
Tdk161 Valued Contributor


Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Fri Jun 10, 2011 12:21 am Post subject: |
|
|
I solved using the wolfsoft's code
I preferred it because I don't want use an external dll
Thank you to all |
|
| Back to top |
|
 |
|
|
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
|
|