mIRC Homepage
Posted By: TECO Remove folder - 23/09/21 09:21 PM
Hi guys,

I need a little help.
In the $mircdirscripts\txt\ircop\ folder where I save files that all end with the .pop extension, I want that when the folder is empty, mIRC deletes the ircop folder.

The command I created is not working:
Code
alias teste {
  if ($findfile($mircdirscripts\txt\ircop,*.pop,1)) { .rmdir $mircdirscripts\txt\ircop }
}

Does anyone know what the solution?
Thanks!
Posted By: TECO Re: Remove folder - 24/09/21 11:31 PM
I have already found a solution wink

Code
alias test {
  var %f = $findfile($mircdirscripts\txt\ircop,*.cop,1)
  if (!$isfile(%f)) { .rmdir $_txtdir(ircop) }
}
Posted By: deVilbaT Re: Remove folder - 25/09/21 03:03 AM
Code
alias teste {
  if (!$findfile($mircdirscripts\txt\ircop,*.pop,0)) {
    noop $finddir($mircdirscripts\txt\ircop,rmdir $qt($1-))
    .rmdir $qt($mircdirscripts\txt\ircop)
  }
}

You can remove line with "noop" if you have only files in that folder.
Posted By: TECO Re: Remove folder - 25/09/21 10:48 AM
Sorry but I tested your idea and it doesn't work.

Originally Posted by deVilbaT
Code
alias teste {
  if (!$findfile($mircdirscripts\txt\ircop,*.pop,0)) {
    noop $finddir($mircdirscripts\txt\ircop,rmdir $qt($1-))
    .rmdir $qt($mircdirscripts\txt\ircop)
  }
}

You can remove line with "noop" if you have only files in that folder.
© mIRC Discussion Forums