Internationalization and localization tools


File and Path Function

char *_fullpath(char *absPath, const char *relPath, size_t maxLength);

wchar_t *_wfullpath(wchar_t *absPath, const wchar_t *relPath, size_t maxLength);

TCHAR *_tfullpath(TCHAR *absPath, const TCHAR *relPath, size_t maxLength);

Internationalization (I18n) Function Overview

The _fullpath function formulates the full pathname for a file from its relative path relPath argument, and stores the result in absPath, returning a pointer to the resulting string. In the event of an invalid relative path in relPath, or if the byte-length of the resulting full pathname is greater than maxLength, _fullpath returns NULL.

_wfullpath is the wide version of the function; its string parameters and return are wide character strings, and maxLength is the size of absPath in wide characters, rather than single-byte characters.

_tfullpath is the Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _fullpath or _wfullpath.

I18n Issues

Use the appropriate version of the function as required for internationalization support, ensuring that maxLength is correct for the chosen platform. See Locale-Sensitive Length Functions for a discussion on single-byte and wide character sizes.

For a Windows MBCS application, _fullpath depends on the multibyte code page in effect. By default, the multibyte code page is set to the system-default ANSI code page obtained from the operating system at program startup. Use _getmbcp and _setmbcp to query or change the current multibyte code page, respectively.

See Pathnames for a discussion of path and filename considerations in an internationalized application.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

File and Path Functions

 

Lingoport internationalization and localization services and software