19 #ifndef __itkFileTools_h
20 #define __itkFileTools_h
46 #include "itksys/SystemTools.hxx"
56 if ( dir == ITK_NULLPTR || itksys::SystemTools::FileExists(dir,
true) )
58 ExceptionObject eo( __FILE__, __LINE__,
"directory cannot be created" );
65 if ( s ==
"" || s ==
"." || itksys::SystemTools::FileIsDirectory(dir) )
71 itksys::SystemTools::MakeDirectory( dir );
74 if ( !itksys::SystemTools::FileIsDirectory(dir) )
76 ExceptionObject eo( __FILE__, __LINE__,
"directory cannot be created" );
85 if ( fn == ITK_NULLPTR || *fn == 0 || itksys::SystemTools::FileIsDirectory(fn) )
93 if ( itksys::SystemTools::FileExists(fn,
true) )
99 std::string dir = itksys::SystemTools::GetFilenamePath( fn );
103 itksys::SystemTools::Touch( fn,
true );
106 if ( !itksys::SystemTools::FileExists(fn,
true) )
115 #endif // __itkFileTools_h
Standard exception handling object.