file reader open for too long


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: file reader open for too long

  1. #1
    Join Date
    Apr 2005
    Posts
    2

    file reader open for too long

    posted April 24, 2005 07:58 AM
    --------------------------------------------------------------------------------
    I have an application which opens a file does processing.The file is a big one so we do this in a loop.We read every 1000 lines once ina loop.the whole reading takes approx 20 sec but processing takes 2-3 hours as there are hughe processing logic for that stream.after the (reading+processing) we close the stream.Is this a problem.Will this be consuming more resources as compared to closing the stream in every loop.
    Has anybody got any problems not closing the stream for so long.Mind you this is an input stream and not an output stream.

    The option is to open the file read and close and do the processing.Then the file reading will start from scratch skip the first 1000 or 2000 lines(which has been read in earlier loop).This can be some performance degradation.
    The other may be not closing the file so that evrytime we get the reader positioned at particular line.In this case reader may be opened continously for several hours whithout any operation(as there is heavy processing involved).Pl advice advantage and disadvantage for both and which one should be used.
    Last edited by manjusingh; 04-24-2005 at 03:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center