This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 14074
    
  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: 38045
    
  22
. . . as long as no other program requires access to that file.
Rob Spoor
Sheriff

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