Re: How to test if file exists?

2000-08-28 Thread Skip Montanaro
Kai> Ok. Another alternative would be to use `/usr/bin/test -e FILE; Kai> echo $?'. But that doesn't work, because FreeBSD has /bin/test Kai> rather than /usr/bin/test. And Linux has /usr/bin/test rather than Kai> /bin/test. Solaris has both. And of course I cannot find out

Re: How to test if file exists?

2000-08-27 Thread Daniel Pittman
On 27 Aug 2000, Kai Großjohann <[EMAIL PROTECTED]> wrote: > On 27 Aug 2000, Daniel Pittman wrote: > >> Alternately, couldn't you bootstrap the thing with some Unix >> assumptions: /tmp (or the content of ${TEMP} or ${TMP}) will be a >> directory in which we can create files, and that creating a

Re: How to test if file exists?

2000-08-27 Thread Kai Großjohann
On 27 Aug 2000, Daniel Pittman wrote: > Alternately, couldn't you bootstrap the thing with some Unix > assumptions: /tmp (or the content of ${TEMP} or ${TMP}) will be a > directory in which we can create files, and that creating a file in > such a directory... I think we can be pretty sure that

Re: How to test if file exists?

2000-08-26 Thread Daniel Pittman
On 26 Aug 2000, Kai Großjohann <[EMAIL PROTECTED]> wrote: > Somebody suggested `ls -d FILE | wc -l'. Maybe with a judicious > `2>/dev/null' thrown in. > > What do you think? Assuming that there isn't an ls out there that spits out the error message onto stdout, rather than stderr, when the fil

Re: How to test if file exists?

2000-08-26 Thread Kai Großjohann
Somebody suggested `ls -d FILE | wc -l'. Maybe with a judicious `2>/dev/null' thrown in. What do you think? kai -- I like BOTH kinds of music.

How to test if file exists?

2000-08-26 Thread Kai Großjohann
I used to use `ls -d FILE; echo $?' to test if a file exists. That, however, fails with NetBSD 1.4 because there the ls program has a bug: it doesn't set the exit status correctly. Therefore, I have now switched to `test -e FILE; echo $?'. And now I find that the Solaris /bin/sh has a test buil