× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Wednesday 17 October 2001 01:30, James Rich wrote:

>
> Ah, well it does actually, as long as outputfile is a directory.

Hmmm...

> And
> since in unix everything is a file then I was technically correct in
> calling it outputfile.

Hmm again...

>However I didn't intent it that way but instead
> wanted what you say below.  By the way it is apparent why it doesn't work:
>
> james@orion:~> cp test1 test2 test3 test4
> cp: copying multiple files, but last argument `test4' is not a directory
> Try `cp --help' for more information.

The error message you get depends on the unix you are running....
but what I really meant was that the command is such a simple one and yet
it's very easy to get it wrong and noone notice... if the command documented
itself mistakes would be much easier to spot.

Gnu (I believe it's them) understand this and convert the cryptic 'options'
into real words, making the command document itself, eg:
cp --recursive --update * /backup

but this could be improved again:
cp --recursive --update fromfile(*) todir(/backup)

>
> I think you better explain what you mean by error-recovery code before I
> make too many statements about that.  What does happen is:
>
> james@orion:~> chmod a-r test2
> james@orion:~> cat test1 test2 test3 > test4
> cat: test2: Permission denied
>
> test4 contains the contents of test1 and test3, which is exactly right.

This isnt correct if you wanted test2 in there as well... I'm not saying Unix
cant detect the error, but that by putting too much into one command it's
harder to recover from one part of it... this is machine independent:

I would much prefer that test4 exists only when test1,2,3 have been used, eg:

rm test4
cat test1 > test
cat test2 >> test
cat test3 >> test
cat test > test4

I also think that this is the 'Unix' way - simple steps that do a single
task, joined together.

> If this were a RDBMS then things had
> better stop and say that the sequence couldn't be completed, so none of it
> was done.  But this isn't, so it does what it can.

I disagree - any reliable system should be able to stop at a 'breakpoint' and
present it's status. Ideally it should understand the error and know what to
do about it... eg the CL equivalent should be able to CHKOBJ before it
assumes that the files are there and it has authority.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.