FFIND and _?

May 20, 2008
9,192
60
Syracuse, NY, USA
If I ask FFIND to find a file, it returns 0 whether or not the file is found.
Code:
v:\> ffind foooo

      0 files

v:\> echo %_?
0

v:\> ffind process.txt
V:\process.txt

      1 file

v:\> echo %_?
0
If I ask it to find text, it returns 0 whether or not the text is found.
Code:
v:\> ffind /t"foo" process.txt

  0 lines in      0 files

v:\> echo %_?
0

v:\> ffind /t"auto" process.txt

---- V:\process.txt
ftp://lucky.syr.edu/4plugins/4autotray.zip

  1 line in      1 file

v:\> echo %_?
0
WAD?
 

rconn

Administrator
Staff member
May 14, 2008
10,921
97
WAD. As with DIR, not finding something isn't an error. FFIND returns non-zero only if there's an error of some type (syntax, OS, whatever).

If you want to see if FFIND found any files or text, you should be using the command variables (i.e., %_ffind_files, %_ffind_matches).