X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: "Jeffrey Powell" To: Subject: Broken findfirst Date: Wed, 5 Dec 2001 15:55:21 +0900 Message-Id: <000801c17d59$cf749550$1002a8c0@ygtynecs01097> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0009_01C17DA5.3F5C3D50" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C17DA5.3F5C3D50 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Sorry I can’t access the newsgroup through my company’s proxy. 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. Works: iFndStatus=findfirst(“C:\\*.*”, &f, FA_HIDDEN | FA_SYSTEM | FA_DIREC); while(!iFndStatus) { printf("%s \n",f.ff_name); iFndStatus=findnext(&f); } Results as expected. j-powell AT pb DOT jp DOT nec DOT com ------=_NextPart_000_0009_01C17DA5.3F5C3D50 Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable

Sorry I can=1B$B!G=1B(Jt access the newsgroup through my = company=1B$B!G=1B(Js proxy.

 

Findfirst/findnext only works with hardcoded = pattern.

 

Does not work:

        = ;    iFndStatus=3Dfindfirst(av[1], &f, FA_HIDDEN | FA_SYSTEM | = FA_DIREC);

        = ;    = while(!iFndStatus)

        = ;    {

        = ;            =     printf("%s \n",f.ff_name);

        = ;            =     = iFndStatus=3Dfindnext(&f);

=

        = ;    }

Result:

        = ;    findfirst() returns 0 and the first matching = file.

        = ;    findnext() returns 1 =1B$B!H=1B(JNo more files (ENMFILE)=1B$B!I=1B(J, loop = terminates.

 

 

Works:

        = ;    = iFndStatus=3Dfindfirst(=1B$B!H=1B(JC:\\*.*=1B$B!I=1B(J, &f, FA_HIDDEN | FA_SYSTEM | = FA_DIREC);

        = ;    = while(!iFndStatus)

        = ;    {

        = ;            =     printf("%s \n",f.ff_name);

        = ;            =     = iFndStatus=3Dfindnext(&f);

=

        = ;    }

Results as expected.

 

j-powell AT pb DOT jp DOT nec DOT com<= /p>

 <= /p>

------=_NextPart_000_0009_01C17DA5.3F5C3D50--