Replaces the normal LEADTOOLS function for opening a file.
virtual L_INT LBaseFile::RedirectOpenCallBack(pFile, nMode, nShare)
Character string containing the name of the file to load.
The access mode for the file. Possible values are:
|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:
|S_IREAD|| 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|| 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.|
|>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.
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries