Ben wrote:
>How
>can it tell there is a mistake?
Simple, check to see if the files/directories specified exist.
>That is very windows-like, "Oh, that
>looks like a mistake, I won't let you do that."
Not "looks like" - "is", there's a big diffrence.
>Like in IRC in a busy
>channel, someone says "Press Alt-F4 to see private messages!",
>and you'll see a couple of people leave. Should the IRC program
>stop that? (Yes I know pretty crappy example)
It could ask if you really wanted to quit, were you could choose "always
yes", "yes" or "no".
>You sure? You can't predict a fool's actions unless you are a fool
>yourself. And I'm not calling you a fool.
Thanks, I don't think anyone here is that either ;-)
And it isn't about predicting the errors, it's about verifying that the
input is correct.
>Um, a * is very "greedy" and will take everything. Some DOS's are
>more smart and the * is not so greedy (including the one in W98),
>but it is the case in MS-DOS.
>
>In other words, *ball.com will match every *.com, in MS-DOS <6.x
>at least. Oh, you'll find a 0-byte file called COM...
Oh, "del *ball.com" will remove all .com files yes, of course. But this is
a correct syntax and this was NOT what I wanted to point out. For instance
take this as an example instead:
"program somefile.ext" where somefile.ext doesn't exist - it's rather easy
for the program to check that this file doesn't exist. For instance this
isn't good:
program.bat:
deltree/y %1\*.*
While this one is a bit better:
if not "%1"=="" deltree/y %1\*.*
And this one is the best (some kind of output would also be good of course
telling the user that it was n't correct)
if "%1"=="" goto end
if not exists %1\*.* goto end
deltree/y %1\*.*
:end
IMHO it looks to me as Linux uses the first one, while DOS the last one (or
atleast number two).
>Remember the "Arachne Virus" from only days ago? A temporary
>glitch in the thinking of Michael.
Well, anyone of us here who say the BATch file are (almost) as guilty as
Michael.