|
Joined: Oct 2003
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Oct 2003
Posts: 7 |
who can make a command who is listing the folders and files from a folder without to list the files from subfolders ?
i use this example, and sux $findir(c:,*,0)
|
|
|
|
Joined: Nov 2003
Posts: 228
Fjord artisan
|
Fjord artisan
Joined: Nov 2003
Posts: 228 |
If you specify a depth of 1 with $finddir or $findfile, mIRC will not search any subdirectories.
//echo -a $findfile(c:\mirc\,*,0,1) searches at a depth of 1 folder, only return files in c:\mirc
//echo -a $findfile(c:\mirc\,*,0,2) searches at a depth of 2 folders, returning any files found in c:\mirc\download, etc.
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Actually, those two commands do not list all the files, they merely count how many are found. The fix is simple: you can add a command in the $findfile, and it will perform that command on every file found. Don't be making complex things here tho, if you want to do more than a single command, parse it through an alias, or it will become awful.
//echo -a $findfile("c:\program files\mirc\",*,0,1,[color:red]echo -s $1-[/color])
The part in red will be performed on every file found, in this case, the full path will be echoed in the status window.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
I tried to come up with a start for you
/listfolders .echo -q $findfile($mircdir,*,0,listfiles $nofile($1-)) | readfilelist
/listfiles {
var %data = $replace($$1-,$chr(32),$chr(160))
writeini listfiles.ini folders %data %data
echo -s $1-
}
/readfilelist {
var %foldercount = $ini(listfiles.ini,folders,0)
var %i = 1
:Loop
var %getfolder = $replace($ini(listfiles.ini,folders,%i),$chr(160),$chr(32))
echo -a %getfolder has $findfile(%getfolder,*,0) Files
inc %i
if (%i <= %foldercount) { goto Loop }
}
you will note that using this will cause mIRC to "lock up" while it runs. I have it set to just read the mIRC folder and that alone caused my mIRC to stall.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You can speed it up quite a lot with a couple of simple changes... listfolders {
window -n @filelist | clear @filelist | .fopen -no list files.lst
echo -e @filelist * $!mircdir has $finddir($mircdir,*,0,.fwrite -n list $1-).shortfn $&
dirs and $findfile($mircdir,*,0) files
.fseek list 0
while $fread(list) {
echo @filelist $+(5,$longfn($v1),) has12 $findfile($v1,*,0,1) Files
inc %i
}
.fclose list
window -a @filelist
}
|
|
|
|
|