BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 08-20-2009, 11:08 AM   #1 (permalink)
New Member
Join Date: Jul 2009
Model: None
Carrier: None
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default writing from the end of the file - FileConnection or PrintOutPutStream

Please Login to Remove!

Hello all
Im a new blackberry developer and I was assigned to make a log for the app that Im working on. The log is supposed to be written in a file, but everytime the app is executed the new content is not supposed to overwrite the old one.
The thing is that I have not found an outputStream or a method that lets me place the cursor at the end of the file so I can start writing new content without overwriting the old.
So two questions in one:
If I specify:
fileCon = (FileConnection), Connector.WRITE);
Does the writing status asures me that the OutPutStream that I get from fileCon.openDataOutputStream(); will have its cursor at the end of the file?

If not can you please tell me if there is a way to do this?
thanks in advance
Claudio Veas
Old 09-14-2009, 10:57 PM   #2 (permalink)
Knows Where the Search Button Is
Join Date: Sep 2007
Model: 8100
Carrier: Vodafone
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts

Use fconn.openOutputStream(fconn.fileSize()); to write to the EOF.
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Copyright 2004-2014
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.