File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes opening a file for relatively long time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "opening a file for relatively long time" Watch "opening a file for relatively long time" New topic
Author

opening a file for relatively long time

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
I need to open a file and process its data. It has large volume of data and the process takes long time while we process it and save it into backend. If my program has to open this file for at least 10 minutes while reading/processing it (it does not modify the file), will there be any I/O problem ?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14107
    
  16

No, you can keep files open as long as you like.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38353
    
  23
. . . as long as no other program requires access to that file.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

And you don't keep too many files open at the same time. The OS may not like that.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14107
    
  16

But "too many" means keeping open thousands, if not tens of thousands of files at the same time (depending on the operating system).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: opening a file for relatively long time