Article View: borland.public.cppbuilder.nativeapi
Article #10533Re: Windows temp dir problem
From: Martin C
Date: Thu, 01 Apr 2004 16:51
Date: Thu, 01 Apr 2004 16:51
36 lines
2269 bytes
2269 bytes
Thanks Bob so much for your reply. I found the mistake.
BR
"Bob Gonder" <notbg@notmindspring.invalid> wrote in message
news:gn5n6015f7dmu1k4utbve6nau1poucv430@4ax.com...
> Martin C wrote:
>
> >The problem I am facing is that the temp directory contents never get
> >erased, although when I try to delete them manually they get deleted
> >normally! So can someone please tell me where is my mistake exactly
>
> Not exactly, no, but can point to some places for you to look.
>
> >bool __fastcall TForm1::EraseAllFolderContents(const AnsiString &Folder,
> >const AnsiString &MaskToFind)
> >{ //erase all contents of the folder
> >
> > String sFullPath, sFindFilter, sCurrentFolder;
>
> Wondering why you use _both_ AnsiString and String. I'd think you'd
> pick _one_ and stick to it.
>
> > Result = SetFileAttributes(sFullPath.c_str(),
> >wfd.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY);
> > if(!Result)
> > break;
>
> This stops the delete on the first "file" that you can't change.
> You might want to check GetLastError to find out why, and also display
> sFullPath to make sure what your program is trying to do.
>
> For testing, it'd be good to pop up a message box showing your
> sFullPath for every Find.
>
>
Technical Details
Message-ID:
<406cab49@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<406b7a09$1@newsgroups.borland.com> <gn5n6015f7dmu1k4utbve6nau1poucv430@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c9cba57ee1c8629d X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-01 16:10:06 PST From: "Martin C" <martincplus@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <406b7a09$1@newsgroups.borland.com> <gn5n6015f7dmu1k4utbve6nau1poucv430@4ax.com> Subject: Re: Windows temp dir problem Date: Thu, 1 Apr 2004 18:51:00 +0200 Lines: 38 Organization: V Safe 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: 81.10.4.238 Message-ID: <406cab49@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1080863561 81.10.4.238 (1 Apr 2004 15:52:41 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail