aspose 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: 14348
    
  22

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


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Campbell Ritchie
Sheriff

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

Joined: Oct 27, 2005
Posts: 19761
    
  20

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: 14348
    
  22

But "too many" means keeping open thousands, if not tens of thousands of files at the same time (depending on the operating system).
 
jQuery in Action, 2nd edition
 
subject: opening a file for relatively long time