Mail Archives: djgpp/2001/12/05/01:59:49
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f
|
From: | "Jeffrey Powell" <j-powell AT pb DOT jp DOT nec DOT com>
|
To: | <djgpp AT delorie DOT com>
|
Subject: | Broken findfirst
|
Date: | Wed, 5 Dec 2001 15:55:21 +0900
|
Message-Id: | <000801c17d59$cf749550$1002a8c0@ygtynecs01097>
|
MIME-Version: | 1.0
|
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$B!G(Bt access the newsgroup through my company$B!G(Bs 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 $B!H(BNo more files (ENMFILE)$B!I(B, loop
terminates.
Works:
iFndStatus=findfirst($B!H(BC:\\*.*$B!I(B, &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
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-2022-jp">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 9">
<meta name=3DOriginator content=3D"Microsoft Word 9">
<link rel=3DFile-List href=3D"cid:filelist DOT xml AT 01C17DA5 DOT 3E2A9B20">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:UseFELayout/>
</w:Compatibility>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"=1B$B#M#S=1B(J =1B$BL AT D+=1B(J";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-alt:"MS Mincho";
mso-font-charset:128;
mso-generic-font-family:roman;
mso-font-format:other;
mso-font-pitch:fixed;
mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
{font-family:"\@=1B$B#M#S=1B(J =1B$BL AT D+=1B(J";
panose-1:2 2 6 9 4 2 5 8 3 4;
mso-font-charset:128;
mso-generic-font-family:roman;
mso-font-pitch:fixed;
mso-font-signature:-1610612033 1757936891 16 0 131231 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"=1B$B#M#S=1B(J =1B$BL AT D+=1B(J";
mso-fareast-language:JA;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"=1B$B#M#S=1B(J =1B$BL AT D+=1B(J";
mso-fareast-language:JA;}
span.EmailStyle15
{mso-style-type:personal-compose;
mso-ansi-font-size:10.0pt;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:black;}
@page Section1
{size:612.0pt 792.0pt;
margin:99.25pt 3.0cm 3.0cm 3.0cm;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US style=3D'tab-interval:36.0pt'>
<div class=3DSection1>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'>Sorry I can=1B$B!G=1B(Jt access the newsgroup through my =
company=1B$B!G=1B(Js proxy.<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><![if =
!supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'>Findfirst/findnext only works with hardcoded =
pattern.<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><![if =
!supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'>Does not work:<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; </span>iFndStatus=3Dfindfirst(av[1],
&f, FA_HIDDEN | FA_SYSTEM | =
FA_DIREC);<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; =
</span>while(!iFndStatus)<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; </span>{<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:2'>  =
; =
</span>printf("%s
\n",f.ff_name);<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:2'>  =
; =
=
</span>iFndStatus=3Dfindnext(&f);<o:p></o:p></span></font></span></p>=
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; </span>}<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'>Result:<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; </span>findfirst()
returns 0 and the first matching =
file.<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; </span>findnext()
returns 1 =1B$B!H=1B(JNo more files (ENMFILE)=1B$B!I=1B(J, loop =
terminates.<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><![if =
!supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><![if =
!supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'>Works:<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; =
</span>iFndStatus=3Dfindfirst(=1B$B!H=1B(JC:\\*.*=1B$B!I=1B(J,
&f, FA_HIDDEN | FA_SYSTEM | =
FA_DIREC);<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; =
</span>while(!iFndStatus)<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; </span>{<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:2'>  =
; =
</span>printf("%s
\n",f.ff_name);<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:2'>  =
; =
=
</span>iFndStatus=3Dfindnext(&f);<o:p></o:p></span></font></span></p>=
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><span =
style=3D'mso-tab-count:1'>  =
; </span>}<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'>Results as expected.<o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><span class=3DEmailStyle15><font size=3D2 =
color=3Dblack
face=3DArial><span =
style=3D'font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><![if =
!supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'>j-powell AT pb DOT jp DOT nec DOT com</span></fon=
t><font
color=3Dblack><span =
style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
/p>
<p class=3DMsoNormal><font size=3D3 color=3Dblack face=3D"Times New =
Roman"><span
style=3D'font-size:12.0pt;color:black'><![if =
!supportEmptyParas]> <![endif]></span></font><font
color=3Dblack><span =
style=3D'color:black;mso-color-alt:windowtext'><o:p></o:p></span></font><=
/p>
</div>
</body>
</html>
------=_NextPart_000_0009_01C17DA5.3F5C3D50--
- Raw text -