Hi Aaron,

Thank you very much.

I thought when I can seek to a perticular  position and also I opened the file in 
"fileModeUpdate"
mode I can just update at any file position. (Random Access) as follows.

    theStream = FileOpen(0, filename, sysFileTFileStream, HLPRespXMLLibCreatorID, 
fileModeUpdate, &err);
    err = FileSeek(theStream, seekPos, fileOriginBeginning);
    numObjects = FileWrite(theStream, text, (long) sizeof(char), 
(long)(StrLen(text)-1), &err);
    FileClose(theStream);

But, in reality, it looks like what you said, I need to use temporary file to do this 
kind of update.

Thank you,
Chida


Aaron Ardiri wrote:

> > I have been facing some strange problem with File streams. When I update
> > (I mean write some characters to the middle of the file stream), it appears
> > to me that the rest of the contents, that originally were in the
> > filestream, are lost.
>
>   of course.. you clobber the file :)) you have an append mode.. but it
>   only allows you to write to the end of the file stream.. not "in the
>   middle" :))
>
> > I had to write the file contents into a temporary file and then write
> > them back to the file. Do you have any idea or is this the way it is
> > suppose to work?
>
>   what you do sounds about right :))
>
> // az
> [EMAIL PROTECTED]
> http://www.ardiri.com/    <--- free games!
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see 
>http://www.palmos.com/dev/tech/support/forums/


-- 
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