Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

This is in 2.0.1 emulator:

File is successfuly open with ofm equals to _OFM_CREATE (so it should be r/w-able):

m_pIFile = IFILEMGR_OpenFile(m_pIFileMgr, pszFileName, ofm);
if (m_pIFile != NULL)
{
bRet = IFILE_Write(m_pIFile, pData, dwSize);
if (bRet != dwSize)
{
bRet = IFILEMGR_GetLastError(m_pIFileMgr);
}
Write() every time returns 0. pData is (void*) filled in with BLOB from resource file (dwSize is 7478), and pszFileName is a plain file name (no slashes). GetLastError() returns 0x106 (EFSFULL). Why would I get that? MIF editor has some EFS Restriction fields, which were empty. Then I changed that to 50 (files) and 550000 bytes - win dll and bar together dont't have more then 400,000 bytes. I played with those parameters, pumped them up to 1,5MB - nothing - every time IFILE_Write(); returns 0 and GetLastError() EFSFULL.

File seems to get created. Next time, I have to Remove() it. Before removing, bRet = IFILEMGR_GetInfo(m_pIFileMgr, pszFileName, &sfi); returns 0 (file exists), but sfi.dwSize is 0. sfi.szName and sfi.dwCreationDate are ok.

Any suggestions on how to make IFILE_Write() to flush buffer to the file?

Thanks a lot for help!

I'm sorry for this spam. I'm dumb...
bRet = IFILEMGR_GetFreeSpace(m_pIFileMgr, &dwTotal);
DBGPRINTF(" +++ room available on the file system: %lu", dwTotal);
bRet = IFILEMGR_GetFileUseInfo(m_pIFileMgr, &fui);
DBGPRINTF(" +++ max space: %lu used: %lu", fui.dwMaxSpace, fui.dwSpaceUsed); This solves my mistery.
dwTotal did return a huge number: 4294967295, but dwSpaceUsed returned 1575201 - I guess it counts all files I have stored in emulator (including other applets). So, 1.5MB wasn't enough, had to pump it up over that value (to 2550000).
BTW, I couldn't find defaults for MIF file (when no EFS Restrictions are specified). SDK 2.0.1 MIF Editor Help file says there are no restrictions when those fields are blank. It seems there are 1,500,000 bytes (emulator for the particular device related restrictions)?
Thanks and sorry for the spam again.

I'm sorry for this spam. I'm dumb...
bRet = IFILEMGR_GetFreeSpace(m_pIFileMgr, &dwTotal);
DBGPRINTF(" +++ room available on the file system: %lu", dwTotal);
bRet = IFILEMGR_GetFileUseInfo(m_pIFileMgr, &fui);
DBGPRINTF(" +++ max space: %lu used: %lu", fui.dwMaxSpace, fui.dwSpaceUsed); This solves my mistery.
dwTotal did return a huge number: 4294967295, but dwSpaceUsed returned 1575201 - I guess it counts all files I have stored in emulator (including other applets). So, 1.5MB wasn't enough, had to pump it up over that value (to 2550000).
BTW, I couldn't find defaults for MIF file (when no EFS Restrictions are specified). SDK 2.0.1 MIF Editor Help file says there are no restrictions when those fields are blank. It seems there are 1,500,000 bytes (emulator for the particular device related restrictions)?
Thanks and sorry for the spam again.