<snip/>
If you are running basically anything Windows, then the Windows API call
for current directory (according to Msft VS.NET) is as follows:
The GetCurrentDirectory function retrieves the current directory for the
current process.
DWORD GetCurrentDirectory(
DWORD nBufferLength,
LPTSTR lpBuffer
);
Parameters
nBufferLength
[in] Length of the buffer for the current directory string, in TCHARs.
The buffer length must include room for a terminating null character.
lpBuffer
[out] Pointer to the buffer that receives the current directory string.
This null-terminated string specifies the absolute path to the current
directory.
Return Values
If the function succeeds, the return value specifies the number of
characters written to the buffer, not including the terminating null
character.
If the function fails, the return value is zero. To get extended error
information, call GetLastError.
If the buffer pointed to by lpBuffer is not large enough, the return
value specifies the required size of the buffer, in characters,
including the null- terminating character.
<snipped remarks/>
Requirements
Client: Included in Windows XP, Windows 2000 Professional, Windows NT
Workstation, Windows Me, Windows 98, and Windows 95.
Server: Included in Windows Server 2003, Windows 2000 Server, and
Windows NT Server.
Unicode: Implemented as Unicode and ANSI versions. Note that Unicode
support on Windows Me/98/95 requires Microsoft Layer for Unicode.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.