INtime SDK Help
GetFullRtPathName
INtime SDK v7.1 > About INtime > INtime Kernel > Files > GetFullRtPathName

Retrieves the full path and file name of the specified file.

DWORD GetFullRtPathName(
LPSTR lpFileName, // pointer to file name
DWORD nBufferLength, // length of buffer
char *lpBuffer, // pointer to buffer
char **lpFilePart // pointer within buffer to filename part
);

Parameters

lpFileName
The name of the file. The length of the filename is limited to MAX_PATH characters.
nBufferLength
The size of the buffer to receive the null-terminated string for the drive and path, in characters.
lpBuffer
A pointer to a buffer that receives the null-terminated string for the path.
lpFilePath
A pointer to a buffer that receives the address (within lpBuffer) of the final file name component in the path.
This parameter can be NULL.
If lpBuffer refers to a directory and not a file, lpFilePart receives zero.

Remarks

GetFullRtPathName merges the name of the current drive and directory with a specified file name to determine the full path and file name of a specified file. It also calculates the address of the file name portion of the full path and file name.

This function does not verify that the resulting path and file name are valid, or that they see an existing file on the associated volume.

Note that the lpFilePart parameter does not require string buffer space, but only enough for a single address. This is because it simply returns an address within the buffer that already exists for lpBuffer.

Each process has a single current directory buffer.

Multithreaded applications and shared library code should use the GetFullRtPathName function with care, or use GetFullRtThreadPathName. The current directory state written by the SetCurrentRtDirectory function and which is used by this function is stored as a global variable in each process, therefore multithreaded applications cannot reliably use this value without possible data corruption from other threads that may also be setting this value. This limitation also applies to the SetCurrentRtDirectory function. The exception being when the application is guaranteed to be running in a single thread, for example parsing file names from the command line argument string in the main thread prior to creating any additional threads. Using relative path names in multithreaded applications or shared library code can yield unpredictable results and is not supported.

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 lpBuffer buffer is too small to contain the path, the return value is the size, in characters, of the buffer that is required to hold the path and the terminating null character.

If the function fails for any other reason, the return value is zero. To get extended error information, call GetLastRtError.

Requirements

Versions Defined in Include Link to
INtime 4.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also

System & Status