Changeset 3269
- Timestamp:
- 03/31/07 14:58:51 (6 years ago)
- Location:
- ossie/branches/philip-work/framework
- Files:
-
- 2 modified
-
FileManager_impl.cpp (modified) (2 diffs)
-
FileSystem_impl.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossie/branches/philip-work/framework/FileManager_impl.cpp
r3260 r3269 24 24 #include <string> 25 25 26 #include <boost/filesystem/path.hpp> 27 26 28 #include "ossie/cf.h" 27 29 #include "ossie/FileManager_impl.h" … … 30 32 FileManager_impl::FileManager_impl ():FileSystem_impl () 31 33 { 32 DEBUG(4, FileManager, "Entering constructor.") 34 DEBUG(4, FileManager, "Entering constructor."); 35 36 if (boost::filesystem::path::default_name_check_writable()) 37 boost::filesystem::path::default_name_check(boost::filesystem::portable_posix_name); 38 33 39 numMounts = 0; 34 40 mount_table = new CF::FileManager::MountSequence(5); -
ossie/branches/philip-work/framework/FileSystem_impl.cpp
r3264 r3269 35 35 { 36 36 DEBUG(6, FileSystem, "In constructor."); 37 38 if (boost::filesystem::path::default_name_check_writable()) 39 boost::filesystem::path::default_name_check(boost::filesystem::portable_posix_name); 37 40 38 41 root = boost::filesystem::initial_path(); … … 219 222 boost::filesystem::path dirPath(root / directoryName); 220 223 221 ///\todo Create entire path when needed. 222 try { 223 boost::filesystem::create_directory(dirPath); 224 } catch (...) { 225 throw CF::FileException (CF::CFENFILE, "[FileSystem::mkdir] Failed to create directory"); 226 } 227 228 } 229 224 boost::filesystem::path::iterator walkPath(dirPath.begin()); 225 boost::filesystem::path currentPath; 226 while (walkPath != dirPath.end()) { 227 DEBUG(9, FileSystem, "Walking path to create directories, current path " << currentPath.string()); 228 currentPath /= *walkPath; 229 if (!boost::filesystem::exists(currentPath)) { 230 DEBUG(9, FileSystem, "Creating directory " << currentPath.string()); 231 try { 232 boost::filesystem::create_directory(currentPath); 233 } catch (...) { 234 throw CF::FileException (CF::CFENFILE, "[FileSystem::mkdir] Failed to create directory"); 235 } 236 } 237 ++walkPath; 238 } 239 } 230 240 231 241 void FileSystem_impl::rmdir (const char *directoryName) throw (CORBA::SystemException, CF::FileException, CF::InvalidFileName) … … 240 250 boost::filesystem::path dirPath(root / directoryName); 241 251 242 boost::filesystem::remove(dirPath); 243 244 #if 0///\todo Generate proper exceptions 245 if (check != 0) 246 throw CF::FileException (CF::CFENFILE, 247 "[FileSystem_impl::rmdir] Failed to remove directory\n"); 248 #endif 252 ///\todo Fix case where directory contains only other empty directories 253 try { 254 boost::filesystem::remove(dirPath); 255 } catch (...) { 256 } 249 257 } 250 258