- Timestamp:
- May 2, 2009, 6:34:23 PM (16 years ago)
- Location:
- AE/Installer/trunk/source
- Files:
-
- 4 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/Installer/trunk/source/subs.cpp
r298 r306 82 82 83 83 string filename = "\0"; 84 string MODINFO_CFG = "\\Mod_Info.cfg"; 85 86 87 88 DIR *pdir; 89 struct dirent *pent; 90 91 pdir = opendir( path.c_str() ); //"." refers to the current dir 92 if (!pdir){ 93 printf ("\nopendir() failure; terminating"); 94 exit(1); 95 } 96 errno=0; 97 98 while (( pent = readdir(pdir) )){ 99 100 filename = path + '\\' + pent->d_name + MODINFO_CFG; 101 file.open(filename.c_str()); 84 string MODINFO_CFG = "Mod_Info.cfg"; 85 86 try 87 { 88 89 90 directory_iterator end_iter; 91 for ( directory_iterator dir_itr( "./packages" ); 92 dir_itr != end_iter; 93 ++dir_itr ) 94 { 95 96 97 file.open( (dir_itr->path().string() + "/" + MODINFO_CFG ).c_str()); 102 98 103 99 //cout << filename << "\n"; … … 105 101 if(!file.fail() ) 106 102 { 107 //file.open(filename.c_str(), fstream::out); 108 109 //do stuff like adding to vector :P 110 103 cout << dir_itr->path().string() + MODINFO_CFG ; 111 104 //would prefer to push a pointer to a package, but this will do for now 112 105 packages.push_back( fileToModPackage(file) ); … … 116 109 file.clear(); 117 110 118 } 119 120 121 if (errno){ 122 printf ("readdir() failure; terminating"); 123 exit(1); 124 } 125 closedir(pdir); 126 111 112 113 } 114 115 116 } 117 catch ( const std::exception & ex ) 118 { 119 cout << "Warning, something odd happened!\n"; 120 } 127 121 128 122 return packages; … … 376 370 catch( const std::exception & ex ) { 377 371 cout << "Warning, exception " << ex.what() << "!\n" 378 << "You probably need to reGlobalize. ;372 << "You probably need to reGlobalize."; 379 373 create_directory( "./packages/VanillaDats" ); 380 374 }
Note:
See TracChangeset
for help on using the changeset viewer.