INtime SDK Help
GetFullRtThreadPathName
INtime SDK v7 > About INtime > INtime Kernel > Files > GetFullRtThreadPathName

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

DWORD GetFullRtThreadPathName(
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

GetFullRtThreadPathName merges the name of the thread-specific 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 thread has a single current directory. If the thread current directory has not been explicitly set via a call to SetCurrentRtThreadDirectory then the process current directory is used instead.

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 6.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also

System & Status