Article View: borland.public.cppbuilder.nativeapi
Article #12605Re: Searching for an deleting files
From: Remy Lebeau (TeamB)
Date: Sun, 30 Nov 2003 05:16
Date: Sun, 30 Nov 2003 05:16
20 lines
1553 bytes
1553 bytes
"Greg Stantin" <gstantin@stantonassoc.com> wrote in message
news:3fc97723@newsgroups.borland.com...
> Exactly where do i put the code to delete the file when i find it?
In the place where you are testing the file attributes. If the attributes
do not represent a directory, then delete the filename. For example:
String sName(Data.cFileName);
if( (sName != ".") && (sName != "..") )
{
if( (Data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 )
DeleteFilesInDirectory(Directory + sName + "\\", Mask);
else
DeleteFile(Directory + sName);
}
Gambit
Technical Details
Message-ID:
<3fc97c1a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fc97723@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,de74c80c594dbf57 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-29 21:38:53 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3fc97723@newsgroups.borland.com> Subject: Re: Searching for an deleting files Date: Sat, 29 Nov 2003 21:16:09 -0800 Lines: 22 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: 67.22.137.149 Message-ID: <3fc97c1a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1070169114 67.22.137.149 (29 Nov 2003 21:11:54 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail