Regarding IFILE | developer.brewmp.com Regarding IFILE | developer.brewmp.com

Developer

Regarding IFILE

Forums:

Hi all,

Does thses two lines of code make any sense as in is it of much use?

Since we are just getting handle to the file and not doing anything what is the need to use IFILE_Release(file)?

IFile* file = ( IFile * )ompMain->factory->file->getHandle( name, OPEN_WRITE | FILE_TEXT );

IFILE_Release( file );

Thanx

diya007 wrote:Hi all,
Does thses two lines of code make any sense as in is it of much use?
Since we are just getting handle to the file and not doing anything what is the need to use IFILE_Release(file)?
IFile* file = ( IFile * )ompMain->factory->file->getHandle( name, OPEN_WRITE | FILE_TEXT );
IFILE_Release( file );
Thanx
"The IFile Interface functions allow you to read and modify the contents of files created with the IFileMgr Interface . To obtain an instance of the IFile Interface for a file, you call IFILEMGR_OpenFile() for that file. You then use the IFile Interface pointer returned by IFILEMGR_OpenFile() to access that file with the operations described below. When you have completed access to the file, you call IFILE_Release() to close it. "
the lines above might be used to create the file in case it doesn't exist.
the only way i know to get a hander is to call openFile as said in the text above (To obtain an instance of the IFile Interface for a file, you call IFILEMGR_OpenFile() for that file) . Any interface must be released on destroying the app.

diya007 wrote:Hi all,
Does thses two lines of code make any sense as in is it of much use?
Since we are just getting handle to the file and not doing anything what is the need to use IFILE_Release(file)?
IFile* file = ( IFile * )ompMain->factory->file->getHandle( name, OPEN_WRITE | FILE_TEXT );
IFILE_Release( file );
Thanx
"The IFile Interface functions allow you to read and modify the contents of files created with the IFileMgr Interface . To obtain an instance of the IFile Interface for a file, you call IFILEMGR_OpenFile() for that file. You then use the IFile Interface pointer returned by IFILEMGR_OpenFile() to access that file with the operations described below. When you have completed access to the file, you call IFILE_Release() to close it. "
the lines above might be used to create the file in case it doesn't exist.
the only way i know to get a hander is to call openFile as said in the text above (To obtain an instance of the IFile Interface for a file, you call IFILEMGR_OpenFile() for that file) . Any interface must be released on destroying the app.