| View previous topic :: View next topic |
| Author |
Message |
Emmanuel Guest
|
Posted: Fri Feb 25, 2005 1:22 am Post subject: How can I know the Temp Directory by using C++builder 6.0? |
|
|
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
|
Posted: Fri Feb 25, 2005 1:45 am Post subject: Re: How can I know the Temp Directory by using C++builder 6. |
|
|
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
|
Posted: Fri Feb 25, 2005 2:02 am Post subject: Re: How can I know the Temp Directory by using C++builder 6. |
|
|
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
|
Posted: Fri Feb 25, 2005 2:04 am Post subject: Re: How can I know the Temp Directory by using C++builder 6. |
|
|
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
|
Posted: Fri Feb 25, 2005 9:22 am Post subject: Re: How can I know the Temp Directory by using C++builder 6. |
|
|
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
|
Posted: Fri Feb 25, 2005 1:46 pm Post subject: Re: How can I know the Temp Directory by using C++builder 6. |
|
|
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
|
Posted: Fri Feb 25, 2005 2:26 pm Post subject: Re: How can I know the Temp Directory by using C++builder 6. |
|
|
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
|
Posted: Fri Feb 25, 2005 5:20 pm Post subject: Re: How can I know the Temp Directory by using C++builder 6. |
|
|
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
|
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
|
Posted: Mon Feb 28, 2005 9:13 am Post subject: Re: How can I know the Temp Directory by using C++builder 6. |
|
|
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 |
|
 |
|