PDA

View Full Version : Bug with IFILE_GetInfo ...


Morgan
04-19-2002, 09:35 AM
Let's assume that "mgr" is a valid IFileMgr*


IFile* file = IFILEMGR_OpenFile( mgr, "foo", _OFM_CREATE );

if (file) {
FileInfo info;
int result = IFILE_GetInfo( file, &info );

// If we're here then 'result' must be equal to 'SUCCESS' ... and it is.

if (result == SUCCESS) {
result = IFILEMGR_Test( mgr, info.szName );

// But, if you thought 'result' would be equal to 'SUCCESS' at
// this point you'd be wrong, the file we just created is now
// considered not to exist.
// The reason, as far as I can tell, is that info.szName is the
// full pathname of the file.
}
}


This might not be a problem, except some calls (e.g., ISHELL_BrowseFile()) don't take an IFile*, they want the filename, and if that filename is obtained via an IFILE_GetInfo call then there is some, shall we say, unexpected behavior (and gnashing of teeth).

Now I've only been able to verify this on the emulator, perhaps this isn't a problem on a device ... would anyone happen to know?

btw, is there a way/method to report bugs, whether they be with the emulator or on a device?

kamal
05-03-2002, 02:04 PM
Your observation is correct that this problem is happening because szName in the info struct has the file name with full path.
As a work around you should provide the relative file path after the current directory.

For bug reports you can e-mail the problems to brew-support@qualcomm.com. Support person will verify the error and may contact you for more information to identify the scenario in which this error can be reproduced. After verificaiton it will be logged in our internal bug report database.

-Kamal
BREW Support