Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Opening CSV file in ReadOnly while writing data to it

 
charuta parth
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing huge ammount of data in CSV file. If i open the excel file in 'Read only' or 'Notify' mode, my java program gives Exception as

java.io.IOException: The process cannot access the file because another process has locked a portion of the file

This should be case as opening excel is not locking any thing for writing.

What i am doing is some thing like this,



What should be cause for this?

Appreciate your help..
[ December 11, 2008: Message edited by: Martijn Verburg ]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the subject you gave this post, the file is being written to as you're trying to open it. Not all applications and/or file systems can handle that.

If you really need to open it while it's being written, make a copy of it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic