File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Output to a File

 
s rao
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Let me know what will happene in this scenario:
If I am writing to a file around 100 kb of data using a IOStream. But while writing I am pausing for some time after writing 2kb of data. Suppose if the user tries to open a file in between i.e. before 100 kb is written then will the user see any data. I am not using any kind of buffers.
The main question is whether we can view the data before the stream is closed. Please let me know.
S Rao
 
Rob Ross
Bartender
Posts: 2205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's very possible. Some programs will honor the fact that the file is open for writing and won't let you open it. Others will let you open it for read-only access. It depends on the program and the operating system you are running.
Every file write that the java VM makes goes to an underlying Operating System file buffer. The operating system will flush it to disk periodically as it becomes full. This will continue as long as you are writing to the file in java. So the OS file will keep getting bigger on disk as more data is added to it.
Again, if you open it with a text editor that supports opening a file marked "open for writing" then you will be able to see the data in the file as it was when it was opened.
 
s rao
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ross.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic