Re: Fwd: Recurs Directory Delete

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

 



Andrew Kreps wrote:
[forwarding my response to the list, as the reply function didn't quite work]


Actually, that's not true.  'rm -rf' removes all files, directories
and subdirectories.  Microsoft's del has no analogy to that (although
there was a deltree command in older versions of DOS).  You still have
to manually (or programmatically) iterate through the directory
structure and run 'del *.*' and then 'rd directory' in every single
subdirectory to achieve the same result that the single command 'rm
-rf' gives you on UNIX-like systems.

On 7/14/06, Adam Zey <azey@xxxxxx> wrote:
So? Windows has this thing called the "del" command that does the same
thing as "rm".

Regards, Adam.


Sure it does. I logged into a Win2K box and got help for rmdir/rd:

C:\>rmdir /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

    /S      Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
            tree.

    /Q      Quiet mode, do not ask if ok to remove a directory tree with /S

It seems like "rmdir /S /Q <directory>" is exactly identical to "rm -rf <directory>". It deletes a directory tree (the -r), and doesn't prompt or display anything (the -f).

So, yes, this *CAN* be done on Windows. Sorry if I was wrong about del originally, but my point stands, Windows is not entirely crippled when it comes to the shell :)

Regards, Adam.

--
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