mIRC Home    About    Download    Register    News    Help

Print Thread
Remove folder #269379 23/09/21 09:21 PM
Joined: Jul 2014
Posts: 238
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 238
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!


TECO
irc.PTirc.org (Co-Admin)
Re: Remove folder [Re: TECO] #269383 24/09/21 11:31 PM
Joined: Jul 2014
Posts: 238
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 238
I have already found a solution wink

Code
alias test {
  var %f = $findfile($mircdirscripts\txt\ircop,*.cop,1)
  if (!$isfile(%f)) { .rmdir $_txtdir(ircop) }
}


TECO
irc.PTirc.org (Co-Admin)
Re: Remove folder [Re: TECO] #269385 25/09/21 03:03 AM
Joined: Sep 2005
Posts: 80
deVilbaT Online
Babel fish
Online
Babel fish
Joined: Sep 2005
Posts: 80
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.


when no one watching us
we are invisible
Re: Remove folder [Re: deVilbaT] #269386 25/09/21 10:48 AM
Joined: Jul 2014
Posts: 238
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 238
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.


TECO
irc.PTirc.org (Co-Admin)