aspose file tools*
The moose likes Java in General and the fly likes Opening CSV file in ReadOnly while writing data to it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Opening CSV file in ReadOnly while writing data to it" Watch "Opening CSV file in ReadOnly while writing data to it" New topic
Author

Opening CSV file in ReadOnly while writing data to it

charuta parth
Greenhorn

Joined: Jun 19, 2008
Posts: 4
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
Marshal

Joined: Mar 22, 2005
Posts: 41477
    
  51
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.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Opening CSV file in ReadOnly while writing data to it