/** * * @File : exo_06_1.cxx, Fichiers * * @Authors : A. B. Dragut * * @Date : 2011 * * @Synopsis : etude des fonctions pour les repertoires * chdir(), getcwd() * **/ #include #include #include #include // chdir(), getcwd() #include "CExc.h" #include "nsSysteme.h" // GetCwd(), ChDir() using namespace nsSysteme; // GetCwd(), ChDir() using namespace std; int main(int argc, char * argv []) { try { if (2 != argc) throw CExc ("main()", string ("Usage : ") + argv [0] + " "); const int tailleMaxNomRep (1025); // chemins (NTCS) d'au plus 1024 caracteres char nomRep[tailleMaxNomRep]; // GetCwd(nomRep, tailleMaxNomRep); // cout << "Repertoire courant : " << nomRep << "\n"; ChDir(argv[1]); GetCwd(nomRep, tailleMaxNomRep); cout << "Nouveau repertoire courant : " << nomRep << "\n"; return 0; } catch (const CExc & Exc) { cerr <