virtual L_INT LBaseFile::RedirectOpenCallBack(pFile, nMode, nShare)
Replaces the normal LEADTOOLS function for opening a file.
Character string containing the name of the file to load.
The access mode for the file. Possible values are:
Value | Meaning |
---|---|
O_APPEND | [0x0008] Repositions the file pointer to the end of the file before every write operation. |
O_BINARY | [0x8000] Opens file in binary mode. |
O_CREAT | [0x0100] Creates and opens a new file for writing; this has no effect if the file exists. |
O_EXCL | [0x0400] Returns an error if the file name exists. Only applies when used with O_CREAT. |
O_RDONLY | [0x0000] Opens file for reading only; if this flag is given, neither O_RDWR nor O_WRONLY can be given. |
O_RDWR | [0x0002] Open file for both reading and writing; if this flag is given, neither O_RDONLY nor O_WRONLY can be given. |
O_TEXT | [0x4000] Open file in text mode. |
O_TRUNC | [0x0200] Opens and truncates an existing file to zero length. The contents of the file are destroyed. If this flag is given, you cannot specify O_RDONLY. |
O_WRONLY | [0x0001] Opens file for writing only; if this flag is given, neither O_RDONLY nor O_RDWR can be given. |
LEADTOOLS assumes you will open the file as binary unless the nMode value specifically indicates otherwise. If you use a function that does not open the file as binary by default (ex. _topen) then you should be sure to open the file as binary.
The share mode for the file. Possible values are:
Value | Meaning |
---|---|
S_IREAD | [0000400] Opens the file and denies other programs read access to the file. If the file has been opened for read access by any other program, the callback should return an error. |
S_IWRITE | [0000200] Opens the file and denies other programs write access to the file. If the file has been opened for write access by any other program, the callback should return an error. |
Value | Meaning |
---|---|
>0 | File handle to be used with other I/O functions. |
-1 | An error occurred. |
Override this function to replace the normal LEADTOOLS function for opening a file.
The Redirect input / output functions cannot be used in combination with:
Note: The Redirect input / output functions do not support Kodak PhotoCD (PCD) or FlashPix (FPX) files.
For an example, refer to LFile::StartFeedLoad.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document