Re: "FFIND" Exit Codes?
- From: ak621@xxxxxxxxxxxxxx (Richard Bonner)
- Date: Tue, 1 Apr 2008 12:58:35 +0000 (UTC)
Steve Fabian (ESFabian@xxxxxxxxxxx) wrote:
Richard Bonner wrote:
| Richard Bonner (ak621@xxxxxxxxxxxxxx) wrote:
|| 4DOS 7.61
|
|| I wish to have FFIND look for files witn the "Archive" attribute
|| and to issue exit code `0' if it finds any, `1', if it does not.
|
|| Richard Bonner
| *** Sorry to be a pain, but I still cannot get this to work. The
| relevant batch file section is:
|
| FFIND /A:+A *.*
| IF ERRORLEVEL 1 GOTO NO-NEW-FILES
| IF ERRORLEVEL 0 GOTO BACKUP
|
| The errorlevel `0' is always the result. )-: I tried various
| error-level testing suggestions given in this thread but the result
| was always the same. Theoretically, if I clear all "Archive"
| attributes in that directory, should not the exit code be `1' ?
FFIND is an internal command. The internal commands which duplicate some
CMD.EXE / COMMAND.COM feature often do return an ERRORLEVEL. However, it is
quite possible that FFIND never sets the errorlevel.
*** That is unfortunate. I had always thought that 4DOS had a full set
of exit codes for every command, but never had a need to use them until
now. (I use 4DOS as a secondary shell and incorporate it as needed.)
Try testing the exit code designed for internal commands, _?. It may give
you the information you desire.
*** OK. Thanks.
BTW, if you are using FFIND just to determine whether or not any files with
attribute A are present in a single directory, you can use the @FILES[]
function:
if %@files[*.*,A] gt 0 goto HAVE_NEW
--
HTH, Steve
*** Excellent! That would be what I require.
Thanks for the help.
Richard Bonner
http://www.chebucto.ca/~ak621/DOS/
.
- Next by Date: OT: JPSoft resellers anywhere?
- Next by thread: Re: "FFIND" Exit Codes?
- Index(es):
Relevant Pages
|