Article View: borland.public.cppbuilder.nativeapi
Article #12623Re: Finding Files
From: Luiz Rafael Culik Guimaraes
Date: Sun, 23 Nov 2003 19:44
Date: Sun, 23 Nov 2003 19:44
37 lines
1981 bytes
1981 bytes
Hi
> (meat is food, you meant meet)
ok
>
> > DWORD dwAttr;
> > hFindFile = FindFirstFile( szFile, &pFindFileData );
> > dwAttr = |FILE_ATTRIBUTE_READONLY |FILE_ATTRIBUTE_DIRECTORY;
>
> Don't need the first |
>
> > if (hFindFile != NULL )
>
> This "if" is wrong. [from help]
> "If the function fails, the return value is INVALID_HANDLE_VALUE"
> which is not NULL.
> Try this:
> if( hFindFile == INVALID_HANDLE_VALUE )
> { printf( "FindFirstFile Error# %i\r\n",GetLastError() );
> }else{
ok
> > if( dwAttr & pFindFileData.dwFileAttributes )
> > {
> > printf("File Name: %s : ",pFindFileData.cFileName);
>
> Only prints directories or ReadOnly files.
> Is that what you wanted to do?
yes
Regards
Luiz
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.541 / Virus Database: 335 - Release Date: 14/11/2003
Technical Details
Message-ID:
<3fc10ed8$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.news2me.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3fc0ad9b$1@newsgroups.borland.com> <j9q1svoc9p255rinnfab7mqopmgp7pfv90@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,7c19047fd3108cd2 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-23 11:50:35 PST From: "Luiz Rafael Culik Guimaraes" <culikr@uol.com.br> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fc0ad9b$1@newsgroups.borland.com> <j9q1svoc9p255rinnfab7mqopmgp7pfv90@4ax.com> Subject: Re: Finding Files Date: Sun, 23 Nov 2003 17:44:43 -0200 Lines: 39 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 200.96.111.181 Message-ID: <3fc10ed8$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069616856 200.96.111.181 (23 Nov 2003 11:47:36 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.news2me.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail