mIRC Home    About    Download    Register    News    Help

Print Thread
#82267 07/05/04 03:57 PM
Joined: Apr 2004
Posts: 17
K
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2004
Posts: 17
is there a command to create folders in mirc directory or any other location?

Thanks


RC

#82268 07/05/04 04:09 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
/help /mkdir


New username: hixxy
#82269 07/05/04 04:12 PM
Joined: Apr 2004
Posts: 17
K
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2004
Posts: 17
thanks tidy_trax

RC

#82270 07/05/04 04:14 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
yw laugh


New username: hixxy
#82271 07/05/04 04:31 PM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Only problem with /mkdir is that it doesn't create the entire structure...
ie..
If you want to have M:\Network1\Room666\
But you don't have "M:\Network1" to start with, then it won't create the directory, so if you feel that might become an issue, you may want to make an alias to check each level and then make as it goes.

Too bad /mkdir doesn't have a -b or -s switch (build structure if necessary).
cool

#82272 07/05/04 04:42 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Here's a snippet for that, if anyone wants.

#82273 07/05/04 05:21 PM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Bleh, looks unstable to me. Here's an untest script that should do the trick and is more user-friendly with self made error checking.
Code:
alias makdir {
  if (!$0) { echo $color(info).dd -a makdir: No directory specified | halt }
  else {
    if ($exists($1-)) { goto exists }
    tokenize 92 $replace($1-,/,\)
    var %x = $iif(?:* iswm $1-,1,0)
    while (%x < $0) {
      inc %x | var %d = $gettok($1-,1- %x,92)
      if ($isfile(%d)) { goto exists }
      if (!$exists(%d)) { .mkdir $+(",%d,") }
    }
    return
  }
  :exists
  echo $color(info).dd -a $iif($isdir($1-),Directory,File) already exists: $1-
}


Anyone who uses this, please lemme know if it works or has any flaws in it.
cool


Link Copied to Clipboard