BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Emmanuel
Guest





PostPosted: Fri Feb 25, 2005 1:22 am    Post subject: How can I know the Temp Directory by using C++builder 6.0? Reply with quote



Dear All,

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

using which function?

Thank you


Back to top
Liz Albin
Guest





PostPosted: Fri Feb 25, 2005 1:45 am    Post subject: Re: How can I know the Temp Directory by using C++builder 6. Reply with quote



On Fri, 25 Feb 2005 09:22:47 +0800, Emmanuel wrote:

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

What are you actually looking for?

You may of course continue to use tmpfile().

--
Good luck,

liz

Back to top
Ron Sawyer
Guest





PostPosted: Fri Feb 25, 2005 2:02 am    Post subject: Re: How can I know the Temp Directory by using C++builder 6. Reply with quote



The GetTempPath function retrieves the path of the directory designated for
temporary files. This function supersedes the GetTempDrive function.

DWORD GetTempPath(

DWORD nBufferLength, // size, in characters, of the buffer
LPTSTR lpBuffer // address of buffer for temp. path
);

"Emmanuel" <emmanuel (AT) erphk (DOT) com> wrote

Quote:
Dear All,

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

using which function?

Thank you





Back to top
Emmanuel
Guest





PostPosted: Fri Feb 25, 2005 2:04 am    Post subject: Re: How can I know the Temp Directory by using C++builder 6. Reply with quote

I want to save some temp file to temp folder
and then delete the file which I have created

..SaveToFile(...)

"Liz Albin" <lizalbin (AT) yahooNotThis (DOT) com> ????
news:u0994jrd2gk9.1q8xas9uzdf4a.dlg (AT) 40tude (DOT) net...
Quote:
On Fri, 25 Feb 2005 09:22:47 +0800, Emmanuel wrote:

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

What are you actually looking for?

You may of course continue to use tmpfile().

--
Good luck,

liz



Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Fri Feb 25, 2005 9:22 am    Post subject: Re: How can I know the Temp Directory by using C++builder 6. Reply with quote

If you mean the Windows temporary directory then GetTempPath() is
probably want you want.

--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Back to top
Colin B Maharaj
Guest





PostPosted: Fri Feb 25, 2005 1:46 pm    Post subject: Re: How can I know the Temp Directory by using C++builder 6. Reply with quote

Have a related question....
"Who" is responsible for clearing the windows temporary directory
periodically??

Andrue Cope [TeamB] wrote:
Quote:
If you mean the Windows temporary directory then GetTempPath() is
probably want you want.


Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Fri Feb 25, 2005 2:26 pm    Post subject: Re: How can I know the Temp Directory by using C++builder 6. Reply with quote

Colin B Maharaj wrote:

Quote:
Have a related question....
"Who" is responsible for clearing the windows temporary directory
periodically??

The user :)

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.
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
Bob Gonder
Guest





PostPosted: Fri Feb 25, 2005 5:20 pm    Post subject: Re: How can I know the Temp Directory by using C++builder 6. Reply with quote

Andrue Cope [TeamB] wrote:

Quote:
Colin B Maharaj wrote:

Have a related question....
"Who" is responsible for clearing the windows temporary directory
periodically??

The user Smile

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

Quote:
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.



Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Mon Feb 28, 2005 9:13 am    Post subject: Re: How can I know the Temp Directory by using C++builder 6. Reply with quote

Bob Gonder wrote:

Quote:
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().

Well sometimes we do want the files to hang around but that's an
interesting idea anyway, thanks.

--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.