[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: System file reorganisation
From: |
Kenneth Gangstoe |
Subject: |
Re: System file reorganisation |
Date: |
Thu, 24 Oct 2002 12:23:15 +0200 |
User-agent: |
Mutt/1.3.28i |
Quoting Neil Hotmail (address@hidden):
>
> std::string
> System::get_tmpdir()
> {
> // FIXME: Warning: these hardcoded values are most probably wrong!
> return "c:\\windows\\temp\\";
> }
>
> /* EOF */
Yes, this is very, very wrong.
Look into this:
GetTempPath
The GetTempPath function retrieves the path of the directory designated for
temporary files.
DWORD GetTempPath(
DWORD nBufferLength, // size, in characters, of the buffer
LPTSTR lpBuffer // pointer to buffer for temp. path
);
Parameters
nBufferLength
Specifies the size, in characters, of the string buffer identified by
lpBuffer.
lpBuffer
Pointer to a string buffer that receives the null-terminated string
specifying the temporary file path. The returned string ends with a backslash,
for example, C:\TEMP\.
Return Values
If the function succeeds, the return value is the length, in characters,
of the string copied to lpBuffer, not including the terminating null character.
If the return value is greater than nBufferLength, the return value is the size
of the buffer required to hold the path.
If the function fails, the return value is zero. To get extended error
information, call GetLastError.
- System file reorganisation, Neil Hotmail, 2002/10/24
- Re: System file reorganisation,
Kenneth Gangstoe <=
- Re: System file reorganisation, Neil Hotmail, 2002/10/27
- Re: System file reorganisation, David Philippi, 2002/10/27
- Re: System file reorganisation, Neil Hotmail, 2002/10/27
- Re: System file reorganisation, David Philippi, 2002/10/27
- Re: System file reorganisation, Neil Hotmail, 2002/10/27
- Re: System file reorganisation, Ingo Ruhnke, 2002/10/27
- Re: System file reorganisation, David Philippi, 2002/10/27
- Re: System file reorganisation, Jorrit Tyberghein, 2002/10/27