Internationalization and localization tools


File and Path Function

int readlink(const char *filename, char *buffer, size_t size);

Internationalization (I18n) Function Overview

The readlink function gets the value of the symbolic link filename. The filename that the link points to is copied into buffer. This filename string is not null-terminated; readlink normally returns the number of characters copied. The size argument specifies the maximum number of characters to copy, usually the allocation size of buffer.

Note that if the return value equals size, then it will be unclear as to where or not there was room for the entire filename. Therefore, increase the size of buffer and size and call readlink again.

I18n Issues

Ensure that size is a byte value and that buffer is large enough to hold the resulting single-byte or multibyte characters. See Locale-Sensitive Length Functions for a discussion on multibyte character sizes.

On ANSI UTF-16 platforms, use a conversion function to convert the wide-character strings to multibyte-character strings and then call readlink.

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