[vtkusers] Problem with reading files

Bill Lorensen bill.lorensen at gmail.com
Fri Aug 6 11:06:14 EDT 2010


Take a look at this example:
http://vtk.org/Wiki/VTK/Examples/Utilities/DirectoryFileExtensions

It is similar to your code. but it constructs a full pathname from the
directory and file name.

Bill

On Fri, Aug 6, 2010 at 10:33 AM, dedoel <deeel at tlen.pl> wrote:
>
> Hi, I got a problem with reading files in some VTK library, so I wanted to
> test if simple application where I only read file works... And I got the
> same exception as earlier.
>
> Unhandled exception at 0x63f5bd58 in test.exe: 0xC0000005: Access violation
> reading location 0xcd07c83f.
>
>
> This is my short, test application :
>
>
>
>
> #include <vtkSmartPointer.h>
> #include <vtkDirectory.h>
>
> #include <vtksys/SystemTools.hxx>
>
> int main (int argc, char *argv[])
> {
>
>        vtkstd::string inputDirectory = argv[1];
>        vtkSmartPointer<vtkDirectory> directory =
> vtkSmartPointer<vtkDirectory>::New();
>
>        int opened = directory->Open(inputDirectory.c_str());
>
>        if(opened)
>    {
>
>                int numImages = directory->GetNumberOfFiles();
>
>                for (int i = 0; i < numImages; i++)
>                {
>                vtkstd::string filename = directory->GetFile(i);
>                vtkstd::string ext =
> vtksys::SystemTools::GetFilenameLastExtension(filename);
>
>                }
>        }
> }
>
>
> The exception occurs in the line :
>
> vtkstd::string ext =
> vtksys::SystemTools::GetFilenameLastExtension(filename);
>
> Any ideas?
>
> Dawid
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-reading-files-tp2266699p2266699.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
>



More information about the vtkusers mailing list