Access the default open flag
When you open a smart large object, you can specify the open mode for the data. The open mode describes the context in which the I/O operations on the smart large object are performed. The LO-specification structure uses a bitmask flag, called a default-open-mode flag, to specify the default open mode of a smart large object.
Open-mode constant | Description | |
---|---|---|
MI_LO_RDONLY | Read-only mode | |
MI_LO_DIRTY_READ | Dirty-read mode | |
MI_LO_WRONLY | Write-only mode | |
MI_LO_APPEND | Write/append mode | |
MI_LO_RDWR | Read/write mode | |
MI_LO_TRUNC | Truncate |
These access-mode flags for a smart large object are patterned after the UNIX System V file-access modes. For more information, see Access modes.
Open-mode constant | Description | |
---|---|---|
MI_LO_RANDOM | Random access | |
MI_LO_SEQUENTIAL | Sequential access | |
MI_LO_FORWARD | Forward | |
MI_LO_REVERSE | Reverse |
For more information, see Access methods.
Open-mode constant | Description | |
---|---|---|
MI_LO_BUFFER | Buffered access (Buffered I/O) | |
MI_LO_NOBUFFER | Unbuffered access (Lightweight I/O) |
For more information, see Buffering modes.
Open-mode constant | Description | |
---|---|---|
MI_LO_LOCKALL | Lock-all locks | |
MI_LO_LOCKRANGE | Byte-range locks |
For more information, see Locking modes.
The milo.h header file defines the open-mode constants: MI_LO_RDONLY, MI_LO_DIRTY_READ, MI_LO_WRONLY, MI_LO_APPEND, MI_LO_RDWR, MI_LO_TRUNC, MI_LO_RANDOM, MI_LO_SEQUENTIAL, MI_LO_FORWARD, MI_LO_REVERSE, MI_LO_BUFFER, MI_LO_NOBUFFER, MI_LO_LOCKALL, and MI_LO_LOCKRANGE.
LO-specification accessor function | Description |
---|---|
mi_lo_specget_def_open_flags() | Overrides the system default open mode with the open mode that the default-open-mode flag specifies |
mi_lo_specset_def_open_flags() | Retrieves the default-open-mode flag from the LO-specification structure |
- Use the appropriate open-mode constants. If you need to set more than one default-open-mode value, use the C-language bitwise OR operator (|) to mask open-mode constants together.
- Use the mi_lo_specset_def_open_flags() accessor function to store the default-open-mode flag in the LO-specification structure.
OR operation | Read operations | Write operations |
---|---|---|
MI_LO_RDONLY | MI_LO_APPEND | Starts at the LO seek position and then moves the seek position to the end of the data that has been read | Fails and does not move the LO seek position |
MI_LO_WRONLY | MI_LO_APPEND | Fails and does not move the LO seek position | Moves the LO seek position to the end of the smart
large object and then writes the data The LO seek position is at the end of the data after the write operation. |
MI_LO_RDWR | MI_LO_APPEND | Starts at the LO seek position and then moves the seek position to the end of the data that has been read | Moves the LO seek position to the end of the smart
large object and then writes the data The LO seek position is at the end of the data after the write operation. |
Access capability | Default open mode | Smart-large-object constant |
---|---|---|
Access mode | Read-only | MI_LO_RDONLY |
Access method | Random | MI_LO_RANDOM |
Buffering | Buffered access | MI_LO_BUFFER |
Locking | Whole-object locks | MI_LO_LOCKALL |
You can specify a different open mode for a particular smart large object when you open a smart large object. For more information about how to open a smart large object, see Open a smart large object.