open
- Updated2023-02-21
- 3 minute(s) read
open
int open (const char fileName[], int openFlags, ...);
Purpose
Opens a file with the specified name according to the operation flags and returns a handle to the opened file.
![]() |
Note This function is not in the ANSI standard. You must include lowlvlio.h in your program or interactive window to use this function. |
Parameters
Input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fileName | const char [] | Specifies the name of the file that is opened if successful. Relative pathnames are valid only if relative to the current working directory.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
openFlags | int | Contains flags to specify the allowable operations on the opened file. The flags can be combined with the bitwise OR operator, "|".
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
permissions | ... | A parameter to specify permissions for the file. This parameter is required if the file is being created
by this function call. Otherwise, it is ignored and can be omitted. All of these flags are
compatible with the POSIX standard. However, under Windows, they affect only whether the file is a read-only file.
In Windows:
Summaries Across Owner/Group/Other
|
Return Value
Name | Type | Description |
fileHandle | int | Contains a handle to the opened file if successful. If the open operation fails, open returns -1 and sets errno to a nonzero value. |
Additional Information
Library: ANSI C Library
Include file: lowlvlio.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later