mIRC Home    About    Download    Register    News    Help

Topic Options
#136358 - 26/11/05 10:57 PM Copy directories
Lint Offline
Bowl of petunias

Registered: 26/11/05
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-)
}

Top
#136359 - 27/11/05 08:09 AM Re: Copy directories
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
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

Top
#136360 - 27/11/05 02:46 PM Re: Copy directories
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#136361 - 27/11/05 02:53 PM Re: Copy directories
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#136362 - 25/11/06 09:58 PM Re: Copy directories
Lint Offline
Bowl of petunias

Registered: 26/11/05
Posts: 2
How would I go about copying all the directories in a folder?

Top