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

Developer

Forums

Forums:

Hello everybody,
I have a problem with IFILE_Write.
I use IFILE_Write to write to file, it is OK with Simulator of BREW 3.1.4; but with Simulator of BREW 3.1.2 Ja, I cannot. If I use IFILEMGR_GetLastError, it returns 1 (General failure). I have also set Privilege Level for File.
Could anyone help me? Thank you so much!

Did you checked the "EFS restriction" section in MIF make sure that both Max files and Max Size (Bytes) are not set.

Did you checked the "EFS restriction" section in MIF make sure that both Max files and Max Size (Bytes) are not set.

Could you post your IFile code? We'll need to take a look to see what may be the issue.

Could you post your IFile code? We'll need to take a look to see what may be the issue.

I have not set the "EFS restriction" section in MIF (both Max files and Max Size (Bytes) are empty).

I have not set the "EFS restriction" section in MIF (both Max files and Max Size (Bytes) are empty).

In some Emulator's it is req. to delete the File if it exits before opening in write mode.
If you post you IFile_Write Module it can help us to find out what may be the problem

In some Emulator's it is req. to delete the File if it exits before opening in write mode.
If you post you IFile_Write Module it can help us to find out what may be the problem

Here is my code:
void TestWriteFile() {
AEEApplet *pApp = (AEEApplet*)GETAPPINSTANCE();
IFileMgr *pFileMgr = NULL;
IFile* pf;
char* fileName;
AECHAR* content;
fileName = (char*)MALLOC(sizeof(char)*20);
STRCPY(fileName, "./test/test.txt");
content = (AECHAR*)MALLOC(sizeof(AECHAR)*50);
WSTRCPY(content, "ムービーメールは面倒、電話をかけないでメッセージのみ送りたい");
ISHELL_CreateInstance(pApp->m_pIShell, AEECLSID_FILEMGR, (void **)&pFileMgr);
pf = IFILEMGR_OpenFile(pFileMgr, fileName, _OFM_CREATE);
if(pf){
IFILE_Write( pf, content, WSTRSIZE( content ) - sizeof( AECHAR ) );
IFILE_Release(pf);
}
if (pFileMgr !=NULL)
{
IFILEMGR_Release(pFileMgr);
}

Thank you so much!

Here is my code:
void TestWriteFile() {
AEEApplet *pApp = (AEEApplet*)GETAPPINSTANCE();
IFileMgr *pFileMgr = NULL;
IFile* pf;
char* fileName;
AECHAR* content;
fileName = (char*)MALLOC(sizeof(char)*20);
STRCPY(fileName, "./test/test.txt");
content = (AECHAR*)MALLOC(sizeof(AECHAR)*50);
WSTRCPY(content, "ムービーメールは面倒、電話をかけないでメッセージのみ送りたい");
ISHELL_CreateInstance(pApp->m_pIShell, AEECLSID_FILEMGR, (void **)&pFileMgr);
pf = IFILEMGR_OpenFile(pFileMgr, fileName, _OFM_CREATE);
if(pf){
IFILE_Write( pf, content, WSTRSIZE( content ) - sizeof( AECHAR ) );
IFILE_Release(pf);
}
if (pFileMgr !=NULL)
{
IFILEMGR_Release(pFileMgr);
}

Thank you so much!

Another thing I found out is that file names are case sensitive. Also, if there are directories where you are storing the files then make sure directory name and file name are not the same.

Another thing I found out is that file names are case sensitive. Also, if there are directories where you are storing the files then make sure directory name and file name are not the same.

Both directory name and file name are different and all are in the lower case.

Both directory name and file name are different and all are in the lower case.

Did you find the answer, Hoang?
If not, pls have a look here: http://brewforums.qualcomm.com/showthread.php?t=12031&highlight=EFSFULL :rolleyes:

Did you find the answer, Hoang?
If not, pls have a look here: http://brewforums.qualcomm.com/showthread.php?t=12031&highlight=EFSFULL :rolleyes:

it is same as MAXFILECOUNT problem

it is same as MAXFILECOUNT problem