wood burning stoves 2.0*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 13884
    
  10

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: 36599
    
  16
. . . as long as no other program requires access to that file.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19557
    
  16

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: 13884
    
  10

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
 
Similar Threads
To the Author of the Book: Reverse AJAX
Error in excel sending additional request
Problem with File Downloading Program
Error in excel sending additional request
Web application and cancel a operation that take long time. How do it with EJB 3.1