sopen
int sopen (const char fileName[], int openFlags, int shareFlags, ...);
Purpose
Opens a file with the specified name according to the operation and share flags. sopen returns a handle to the opened file. When an error occurs, sopen returns 0 and sets errno to a nonzero value.
![]() |
Note This function is only available on the Windows version of LabWindows/CVI. |
![]() |
Note This function is not in the ANSI standard. To use this function, you must include lowlvlio.h in your program. |
Parameters
Input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fileName | const char [] |
Specifies the name of the file that is opened if successful. If a relative pathname is used, it is considered to be 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, "|".
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shareFlags | int |
The share flag determines whether other applications can open the file while your application has it open. You may not combine
flags with the bitwise OR operator. The flags are as follows:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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, sopen returns -1 and sets errno to a nonzero value. |
Additional Information
Library: ANSI C Library
Include file: lowlvlio.h
LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later