BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 08-20-2009, 10: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, 09: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.

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