Internationalization and localization tools


File and Path Function

int chmod(const char *filename, mode_t pmode);

int _chmod(const char *filename, int pmode);

int _wchmod(const wchar_t *filename, int pmode);

int _tchmod(const TCHAR *filename, int pmode);

Internationalization (I18n) Function Overview

The chmod and _chmod functions set the access permission bits for the file named by filename to pmode. It returns 0 if the permission setting is successfully changed, and -1 in the event that the file could not be found, in which case, the global errno variable is set to ERRNOENT.

The pmode argument can be set to one of the following permissions:
_S_IWRITE to permit writing to the file;
_S_IREAD to permit reading from the file;
_S_IREAD | _S_IWRITE - to permit both file input and output.

On Windows platforms, _wchmod is the wide-character version of _chmod; its argument is a wide-character string. There is no ANSI wide-character equivalent.

_tchmod is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _chmod or _wchmod.

I18n Issues

Use the appropriate version of the function as required for internationalization support.

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

See Pathnames for a discussion of path and filename considerations in an internationalized application, and File I/O, which addresses reading and writing non-ASCII text data files.

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