POV-Ray : Newsgroups : povray.off-topic : Today's annoyance : Re: Today's annoyance Server Time
29 Jul 2024 08:18:38 EDT (-0400)
  Re: Today's annoyance  
From: nemesis
Date: 9 Feb 2012 12:15:01
Message: <web.4f33fedecfe4adb6773c9a3e0@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Under Unix, if you say
>
>    rm file1
>
> it deletes the specified file. If you say
>
>    rm folder1
>
> it deletes the specified folder. So far so good, eh?
>
> Now consider CMD.EXE, the Windows NT command processor. If you do
>
>    DEL file1
>
> it deletes the specified file. If you now say
>
>    DEL folder1
>
> it asks you "are you sure?". If you add the /Q switch, it will just
> delete the folder... hahaha! No, it won't. Actually, it merely deletes
> the /contents/ of the folder. Actually, you know what? No it doesn't. It
> deletes the /files/ within the folder. Unless you add /S (recursive
> delete), in which case all files in all folders are deleted, but the
> folders themselves remain.
>
> In order to /actually/ delete a folder, you must do
>
>   RMDIR folder1
>
> Oh, but that fails if the folder is not empty, so you must add /S. Oh,
> but that asks for confirmation, so you must add /Q as well.
>
> Short version: To delete an object, you must know whether it is a file
> or a folder. Thanks for that... :-P
>
> Special bonus for failing to document this fact anywhere. (E.g., the
> manual for DEL doesn't mention that there's an RMDIR command.)

there actually is rmdir in Unix too.  And rm dir will only work with the -r
recursive switch.  Unless you simply use rmdir dir, that deletes dir and all.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.