X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Wed, 5 Dec 2001 10:14:30 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Jeffrey Powell cc: djgpp AT delorie DOT com Subject: Re: Broken findfirst In-Reply-To: <000801c17d59$cf749550$1002a8c0@ygtynecs01097> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 5 Dec 2001, Jeffrey Powell wrote: > Findfirst/findnext only works with hardcoded pattern. > > Does not work: > iFndStatus=findfirst(av[1], &f, FA_HIDDEN | FA_SYSTEM | FA_DIREC); > while(!iFndStatus) > { > printf("%s \n",f.ff_name); > iFndStatus=findnext(&f); > } > Result: > findfirst() returns 0 and the first matching file. > findnext() returns 1 No more files (ENMFILE), loop terminates. What's the contents of av[1] in this example? Anyway, my testing shows that findfirst/findnext work for non-constant strings as well as for constant ones. This must be something specific to either your program or your platform.