19 #ifndef itkFileTools_h
20 #define itkFileTools_h
40 static void CreateFile(
const std::string &fn );
48 #include "itksys/SystemTools.hxx"
58 if ( dir.empty() || itksys::SystemTools::FileExists(dir.c_str(),
true) )
60 ExceptionObject eo( __FILE__, __LINE__,
"directory cannot be created" );
66 if ( dir.empty() ||
"." == dir || itksys::SystemTools::FileIsDirectory(dir.c_str()) )
72 itksys::SystemTools::MakeDirectory( dir.c_str() );
75 if ( !itksys::SystemTools::FileIsDirectory( dir.c_str() ) )
77 ExceptionObject eo( __FILE__, __LINE__,
"directory cannot be created" );
86 if ( fn.empty() || itksys::SystemTools::FileIsDirectory( fn.c_str() ) )
94 if ( itksys::SystemTools::FileExists(fn.c_str() ,
true) )
100 std::string dir = itksys::SystemTools::GetFilenamePath( fn.c_str() );
104 itksys::SystemTools::Touch( fn.c_str(), true );
107 if ( !itksys::SystemTools::FileExists( fn.c_str(),
true) )
116 #endif // itkFileTools_h
Standard exception handling object.