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

FINDFIRST behavior changed

Discussion in 'TCC/LE Support' started by Malte, Jan 4, 2017.

  1. Malte

    Joined:
    Jan 4, 2017
    Messages:
    2
    Likes Received:
    0
    When using %@FINDFIRST[...,d] to check whether or not there are any sub directories, the next call of FINDFIRST w/o specifying attrs won't find any regular files.

    Try this in a folder that only contains files:

    Code:
    @echo off
    
    echo first dir: %@FINDFIRST[*.*,d]
    echo %@FINDCLOSE[] > NUL
    
    rem seems findfirst with attr d will result in any upcomming findfirst also searching for attr d (tcc bug?)
    rem echo %@FINDFIRST[*.*,-d] > NUL
    rem echo %@FINDCLOSE[] > NUL
    
    echo first anything: %@FINDFIRST[*.*]
    echo %@FINDCLOSE[] > NUL
    
    
    Expected result: Finds a file
    Actual result: Doesn't find a file

    A workaround is to do a %@FINDFIRST[*.*,-d] after checking for sub folders, but it has the disadvantage that the next FINDFIRST wouldn't find anything in a folder that only contains sub folders and no files.
     
  2. Malte

    Joined:
    Jan 4, 2017
    Messages:
    2
    Likes Received:
    0
    This worked fine in early versions of TCC, and also work as expected in latest TCC/LE
     

Share This Page