[vtkusers] vtkStructuredPointsReader, checking is file exists before using it.

Ziad Rahhal ziz79 at yahoo.com
Fri Oct 6 17:11:41 EDT 2006


Hi,

I am using vtkStructuredPointsReader with files that
do not yet exist in the directory from which the
reader is supposed to pick them up, because the
context is distributed and the visualization must wait
until the first file is available (sent from another
component in the system) before starting the
visualization process.

I am using the Java method 
new File(dir, fileName).exists() in order to check if
the file exists before doing
reader.setFileName(fileName), but the problem is that
once the file is opened for write (when it arrives),
the above java method detects that the file becomes
available and triggers the setFileName method even
before the file is completely filled with the
necessary data, so I end up with rendering nothing
(with a warning error from the reader for sure). I
know I can waste some time (do a sleep) until the file
is filled but I am doing measurements and I don't want
extra time, I also might be able to do things in Java
like opening the file and check its content but I am
avoiding additional overhead. So before proceeding in
any of these I wanted to ask:

Is there any way in solving this through vtk?  I
thought maybe the setFileName method can be useful for
such a thing as well. Any idea? 

Thank you for your time,
Ziad

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the vtkusers mailing list