Internationalization and localization tools


File and Path Function

int open(const char *filename, int oflag [, int pmode]);

int _open(const char *filename, int oflag [, int pmode]);

int _wopen(const wchar_t *filename, int oflag [, int pmode]);

int _topen(const TCHAR *filename, int oflag [, int pmode]);

Internationalization (I18n) Function Overview

The open function opens a file at the OS level; returning a file handle if successful, or -1 to indicate an error (and the global variable errno will be set with the error number).

_open is the same as open, supported on Windows platforms.

Also, on Windows platforms, _wopen is the wide-character version of _open; its argument is a wide-character string. There is no ANSI wide-character equivalent.

_topen is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _open or _wopen.

See the MSDN Library for details on the possible oflag and pmode settings on Windows systems; or the GNU C Library for settings supported by the GCC compiler.

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 open.

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