Re: simple command help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What's the command to use if I want to remove all the directories and files except 'a.gz' under a directory?

There isn't one. If you're using *nix, you could try this:

exec('find ! -name a.gz -maxdepth 1 -exec rm -rf {} \;');

Or something like that. If you're on Windows you'll need someone else... :-)

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux