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 


Filelist only root Dir without Path ?

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


Joined: 14 May 2004
Posts: 24

PostPosted: Fri Oct 01, 2004 5:58 pm    Post subject: Filelist only root Dir without Path ? Reply with quote

This problem makes me really Crazy, and I can't find a propper Solution for it...
May one of the Crack's knew something... Embarassed
I'm shure I missed a simple Command again... Embarassed Embarassed

I wrote a Programm witsh uses Dir's as Article Nr.
Right now I'm using a bat file to get the Dirlisting into a file, but It's not really a solution.
Dir *. /b > x.txt

Now I tried it with.....
Code:
 
%%WebPD = SomePath
List filelist,Dirlist,%%WebPD*.,*

... witsh is'nt really clear to me why first *. and then * for all sub dir's. It does'nt do the sub dir's what I want, but there is still the Path included.

Okay work's... whatever, but I want to remove the Path itself, so that I only get the Article Nr. (..just the Dir Name without Path and drive info)

What works fine is....
Code:

%%WebPD = SomePath
List filelist,Dirlist,@Name(%%WebPD*.),*

... but only in the dir where my prog is placed.

So I expected that this should Work....
Code:

%%WebPD = SomePath
List filelist,Dirlist,%%WebPD@Name(*.),*

.... but it's again with the Path.

Okay what I could do is to remove the Path with the String.dll.... but...
Is'nt there something like ...
Code:
List Dirlist.....


May someone has a better solution than the funky Batsh file.....

Thanks... Wink

_________________
___________________
Gerrit Corsmeyer
Gerrit@corsmeyer.de
www.corsmeyer.de
___________________
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Oct 01, 2004 11:16 pm    Post subject: Reply with quote

To get a listing of a particular directory and its sub dirs:
Code:

  list create,1
  list filelist,1,c:\*.*,*D


Then to get the name portion of the listing, scan each item in the list
using the @name() function on each list item. You can then either add the
@name() results to another string list and save it to a file, or you can use
'List put,1,@name(@item(1))' to replace each items full path with just its
name., then save the file to disk.

Hope this helps,

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Oct 01, 2004 11:46 pm    Post subject: Reply with quote

See if this little script does what ya want:
Code:


  %%fileSpec = c:\*.*
  %%saveAsFile = c:\dirNames.txt

  list create,1
  list filelist,1,c:\*.*,*D
  if @greater(@count(1),0)
    %x = 0
    repeat
      %I = @item(1,%x)
      if @not(@null(%I))
        list put,1,@name(%I)
      end
      %x = @succ(%x)
    until @equal(%x,@count(1))
  end
 
  list sort,1
 
  dialog create,Get Folder Names,-1,0,200,300
  dialog add,LIST,L1,5,5,190,290
  dialog show
 
  list assign,L1,1

  rem Uncomment the following to save the file
  rem list savefile,1,%%saveAsFile
  list close,1
 
:Evloop
  wait event
  goto @event()
 
:CLOSE
  exit


Does this help?

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
gerrit
Newbie


Joined: 14 May 2004
Posts: 24

PostPosted: Sat Oct 02, 2004 12:14 am    Post subject: Reply with quote

Yeep Thank's...
Was the Parameter ,*D what I missed in the Filelist.
Good Idea to switsh the UI Off..Wink

merci.. Very Happy
G.

_________________
___________________
Gerrit Corsmeyer
Gerrit@corsmeyer.de
www.corsmeyer.de
___________________
Back to top
View user's profile Send private message Visit poster's website
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