1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FFIND and _?

Discussion in 'Support' started by vefatica, Nov 1, 2016.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,885
    Likes Received:
    29
    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?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,808
    Likes Received:
    82
    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).
     

Share This Page