[vtkusers] Problem in reading more than 1000 files by vtk readers

Robert Maynard robert.maynard at kitware.com
Fri Feb 10 09:04:09 EST 2012


Can you please try this patch please. It looks like each time the file was
rewound it would reopen the file creating an extra file handle.

diff --git a/IO/vtkTecplotReader.cxx b/IO/vtkTecplotReader.cxx
index 7713098..4f64d2c 100644
--- a/IO/vtkTecplotReader.cxx
+++ b/IO/vtkTecplotReader.cxx
@@ -62,7 +62,10 @@ class FileStreamReader
 {
 public:
   FileStreamReader();
-  ~FileStreamReader(){};
+  ~FileStreamReader()
+    {
+    this->close();
+    }

   bool open(const char* fileName);
   bool is_open()const{return Open;};
@@ -144,7 +147,6 @@ void FileStreamReader::rewind()
 {
   if ( this->Open )
     {
-    this->Open = false;
     this->Eof = false;
     this->Pos = this->BUFF_SIZE;
     this->BuffEnd = this->BUFF_SIZE;


On Mon, Feb 6, 2012 at 1:22 PM, Ahmad <falahatpisheh at gmail.com> wrote:

> hi Dave,
>
> Unfortunately, it did not help. I set a breakpoint on
> *this->Internal->ASCIIStream.close()* and it is called every time in the
> loop. This means that close function is executed. However, it does not
> release the file handle. I am not sure if gzclose(this->file) releases the
> file handle.
>
> I also increased the maximum number of file handles and it now reads more
> files. But this is only a temporary solution to this problem.
>
> Please let me know of your thoughts.
>
> Ahmad
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Problem-in-reading-more-than-1000-files-by-vtk-readers-tp5459233p5460860.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Robert Maynard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120210/13f8746f/attachment.htm>


More information about the vtkusers mailing list