aspose file tools*
The moose likes Beginning Java and the fly likes Able to save File but unable to write to file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Able to save File but unable to write to file" Watch "Able to save File but unable to write to file" New topic
Author

Able to save File but unable to write to file

Kim wee
Greenhorn

Joined: Nov 25, 2011
Posts: 5
Hi

Im having this weird problem where im able to save a new file but im unable to write into the saved file.

care to explain where and what went wrong with my code?

Thanks in advance!
cheers!

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

How do you know you are unable to write to the file?
Kim wee
Greenhorn

Joined: Nov 25, 2011
Posts: 5
because the file size is 1KB everytime i save the files and when i open the file its empty.
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Kim wee wrote:because the file size is 1KB everytime i save the files and when i open the file its empty.

1 kb is not an empty file... try opening it in a text editor. Writing an object information will take that much size only I think.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
What is the "file" object that you're writing to the file?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19790
    
  20

And how do you open the file? The file will contain binary contents, not text. That means that a text editor will most likely not be very good at displaying the file. A HEX editor is a better choice.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Able to save File but unable to write to file