help-make
[Top][All Lists]
Advanced

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

Re: How to check if a file exists?


From: David Boyce
Subject: Re: How to check if a file exists?
Date: Tue, 20 May 2008 10:18:19 -0400

On Tue, May 20, 2008 at 8:21 AM, Greg Chicares <address@hidden> wrote:
> I see nothing wrong with your original code:

Yes, it looks correct except for not affecting the exit status, which
after all was the original point. But that may have just been for
demonstration purposes. Personally I would go with something shorter
and simpler:

    '$(BITROCK_SYSTEM)' build '$(XML)' windows && test -e $(OUTPUT)/*.exe

which doesn't require a lot of continuation lines.

Also, of course, you're running a Windows executable but showing Unix
shell syntax. Again, that may be for demo purposes or due to having
Cygwin et al but it's worth noting.

Last, I'm not sure if the *.exe wildcard is there for a good reason,
but if so one nice thing about "test -e" is that it ignores arguments
after the first so you can safely use it with a wildcard. OTOH if you
know the name of the output file it's better to write your action in
terms of address@hidden

-David Boyce




reply via email to

[Prev in Thread] Current Thread [Next in Thread]