◆ Open() [1/2]
Returns a file descriptor for a given file name (string). Performs the operations needed to make the file descriptor usable by the other methods of the interface (for e.g. ask the OS for a valid file handle).
- AK_Success: A valid file descriptor is returned
- AK_FileNotFound: File was not found.
- AK_Fail: File could not be open for any other reason.
- A file descriptor, which contains
- an unique identifier to be used with functions of the low-level IO interface.
- the total stream size in bytes.
- the offset from the beginning of the file (in blocks).
- a device ID, that was obtained through AK::StreamMgr::CreateDevice().
- The updated io_bSyncOpen flag depending on the File Resolver's deferred opening policy.
- It is illegal to return io_bSyncOpen as false if Open() was called with io_bSyncOpen set to true.
- Deferred file opening requires allocations in the Stream Manager's small object pool. The File Location Resolver should always choose to open files synchronously if it is fast to do so.
- Whether opening is deferred or not, GetBlockSize() is always called right after the first call to Open(), in the client's thread, and is never called again.
||Special flags. Can pass NULL.
||If true, the file must be opened synchronously. Otherwise it is left at the File Location Resolver's discretion. Return false if Open needs to be deferred.
||Returned file descriptor.