HI:
  All,I writing a application that need to write data to palm's file  and read data 
from it.I write a test code ,but it cann't write data to palm(POSE);The next is the 
code, can you tell me what is wrong? if you can give me a simple sample about file's 
write and read.


static void Test()
{

   FileHand fileHand;
   Err err =0;
   Int32 fileSize=0;
   Int32 pos=0;
   
   char data[20];
   MemSet(data,20,'\0');
   
 //write  
  fileHand = FileOpen (0, "testfile", 0, 0,fileModeReadWrite, &err);
   FileWrite(fileHand, "testdata",8, 1, &err);
   err = FileFlush(fileHand);
   FileClose(fileHand);
 
 
   //read
   fileHand=0;
   
   fileHand = FileOpen (0, "testfile",0, 0,fileModeReadWrite,&err);
   pos = FileTell(fileHand,&fileSize,&err);
  
// when if step debug here, pos==0 and err==0 and fileSize==0
 
   FileRead(fileHand,data,8,1,&err);

 // when if step debug here, err=5648

   FileClose(fileHand);
}



   thanks
   zhiyong




___________________________________________________________________
��������Ƶ���������£���Ҫupdate�����ж�����
http://news.163.com


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to