Old 25th January 2004, 10:01   #1
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
how to use findfirst, etc. ?

hello!

i want to get all the filenames of a specific file-type in one specific directory.
i think, i'll have to use FindFirst, FindNext, etc.
but how?

anone can help me?
Comm@nder21 is offline   Reply With Quote
Old 25th January 2004, 11:44   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
>To search for files with a extension and in a certain folder, use (example):

code:
FindFirst $0 $1 "${NSISDIR}\Examples\*.nsi"


Will return to $1 the first file found with *.nsi extension.

$0 is the handle, don't change it until FindClose.

"${NSISDIR}\Examples\*.nsi" is where and what files want to search for.

>To confirm if the returned file is really a file, use (example):

code:
IfFileExists "${NSISDIR}\$1\*.*" IsDir IsFile

IsDir: ;If the file is a dir, will execute this code below

SetErrors

IsFile: ;Returning to normal code



(The example shows that will set errors each time a file is really a folder.)

>To detect the next file with "*.nsi" use (example):

code:
FindNext $0 $1


Will return to $1 the next file found with *.nsi extension.

>To end the detection use (example):

code:
FindClose $0

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 25th January 2004, 12:51   #3
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
thx!
Comm@nder21 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump