mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2003
Posts: 7
L
logy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
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
S
Fjord artisan
Offline
Fjord artisan
S
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
L
Hoopy frood
Offline
Hoopy frood
L
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.

Code:
//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
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I tried to come up with a start for you

Code:
 
/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
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You can speed it up quite a lot with a couple of simple changes...
Code:
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
}



Link Copied to Clipboard