🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7274

Re: How can I know the Temp Directory by using C++builder 6.0?

#7274
From: Bob Gonder
Date: Fri, 25 Feb 2005 17:20
28 lines
2023 bytes
Andrue Cope [TeamB] wrote:

>Colin B Maharaj wrote:
>
>> Have a related question....
>> "Who" is responsible for clearing the windows temporary directory
>> periodically??
>
>The user :)

The programer that wrote it needs to come to your office and remove
the files. :)

>Actually our software maintains its own handles (our equivalent of
>TStream) and when an application opens a temporary file it is noted and
>during shutdown is cleaned up (assuming the caller doesn't unflag it).
>
>Unfortunately this doesn't help me because while debugging I often
>terminate the application and then the shutdown/cleanup module doesn't
>run.

I haven't tested this in debug, but...
If you don't need to close() the file, then you could add
FILE_FLAG_DELETE_ON_CLOSE to your CreateFile().

If you do need to close it, but want it to hang around for a while,
open another instance of the file, and it won't delete until the last
handle is closed.
Technical Details
Message-ID: <03nu11977997446kendeh4hf88omvauafo@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <421e7d08$1@newsgroups.borland.com> <421eee90$1@newsgroups.borland.com> <421f2c35$1@newsgroups.borland.com> <421f35c9@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,50c6f87a9cac27ef
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How can I know the Temp Directory by using C++builder 6.0?
Date: Fri, 25 Feb 2005 09:20:26 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <03nu11977997446kendeh4hf88omvauafo@4ax.com>
References: <421e7d08$1@newsgroups.borland.com> <421eee90$1@newsgroups.borland.com> <421f2c35$1@newsgroups.borland.com> <421f35c9@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.69.91.90
X-Trace: newsgroups.borland.com 1109352023 69.69.91.90 (25 Feb 2005 09:20:23 -0800)
Lines: 30
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail