BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-10-2008, 03:30 PM   #1 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8830
PIN: N/A
Carrier: verizon
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default text file question

Please Login to Remove!

I need to write to a text file in a way that won't overwrite whatever is in there already. Is this possible?

Is the only option to read the whole file into a string, add stuff to the end, and then write the whole thing to the file again?
Offline  
Old 08-10-2008, 04:08 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Check out the API documentation for the interface FileConnection, in particular the methods: fileSize() and openOutputStream(long byteOffset).
Offline  
Old 08-10-2008, 04:22 PM   #3 (permalink)
New Member
 
Join Date: Apr 2008
Model: 8830
PIN: N/A
Carrier: verizon
Posts: 9
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry hrbuckley, I seem to be an idiot today.

I've been working on this thing for the entier weekend (relearning java as I go) and I'm very close to having it fully functional. I'm afraid that I didn't even notice that you could offset the point at which the writer starts writing even though I must have read and stared at the documentation for more then 2 total hours today.

Thanks again man, that should get me to where I want to go.
Offline  
Old 08-10-2008, 06:01 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

No problem. The javadocs are OK once you find your way around but they can be mind numbing. I've missed stuff like that too.
Offline  
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

Measurement Computing USB-1608FS 16-Bit, 200 kS/s DAQ 8 SE Sim Analog Inputs NI
$224.99
Measurement Computing USB-1608FS 16-Bit, 200 kS/s DAQ 8 SE Sim Analog Inputs NI pictureComputer Boards Inc 3495 Analog Input Board ISA Bus
$365.0
Computer Boards Inc 3495 Analog Input Board ISA Bus picturePCIM-DDA06/16 MI1 194380A-01 Measurement Computing 6-Channel 16-Bit PCI Analog
$786.0
PCIM-DDA06/16 MI1 194380A-01 Measurement Computing 6-Channel 16-Bit PCI Analog pictureComputer Boards Inc. 9827 Rev 1 Analog Input Board ISA Bus
$297.0
Computer Boards Inc. 9827 Rev 1 Analog Input Board ISA Bus  pictureComputer Boards Inc. CIO-DAS1600/12 Analog and Digital I/O Board
$49.0
Computer Boards Inc. CIO-DAS1600/12 Analog and Digital I/O Board picture






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