mIRC Home    About    Download    Register    News    Help

Print Thread
#136358 26/11/05 10:57 PM
Joined: Nov 2005
Posts: 2
L
Lint Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
L
Joined: Nov 2005
Posts: 2
I want that will copy the name of the directory and only include a .nfo file from that directory.

Havent really gotten that far, atm its just copy the directories to a .txt file, but it includes the entire path, how would I go about to only copy the directory name?

.Copy to the txt file:{
set %folder $?="What is path?"
$finddir(%folder,*DVD*,0,write dvd.txt $1-)
}

#136359 27/11/05 08:09 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
alias test {
  write -c dvd.txt
  var %x = 1, %folder = $sdir=" Select a folder.. "
  while (%x <= $findfile(%mp3dir,*.nfo,0)) {
    write dvd.txt $findfile(%mp3dir,*.nfo,%x)
    inc %x
  }
}


-Andy

#136360 27/11/05 02:46 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Is it supposed to overwrite dvd.txt with each time this command is issued? Right now it does this.

Code:
alias copydirs {
  var %f = f $+ $ticks, %total, %folder = $$sdir($mircdir,Select a folder)
  .fopen -o %f dvd.txt
  if ($ferr) goto error
  %total = $finddir(%folder,*DVD*,0,.fwrite -n %f $gettok($1-,-1,92))
  echo -ac info * /copydirs: %total directories written to file 
  :error
  if ($fopen(%f)) .fclose %f
}


Gone.
#136361 27/11/05 02:53 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You don't have an %mp3dir variable, and I have also stressed the fact in the past, what a bad idea it is to use $findfile in a loop, it should never ever be used as it's one of the most inefficient things you can do in mIRCScripting.


Gone.
#136362 25/11/06 09:58 PM
Joined: Nov 2005
Posts: 2
L
Lint Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
L
Joined: Nov 2005
Posts: 2
How would I go about copying all the directories in a folder?


Link Copied to Clipboard