/** * @File : exo_04.cxx * * nsFctShell::FileCopy() * * donneTailleMorceau **/ #include #include #include // O_RDONLY #include "CExc.h" #include "nsSysteme.h" // Open(), Read(), Close() using namespace nsSysteme; // Open(), Read(), Close() using namespace std; int main (int argc, char * argv []) { try { if (2 != argc) throw CExc ("main()",string ("Usage : ") + argv [0] + " "); char c; int fD; fD = Open(argv[1],O_RDONLY); Read(fD,&c,sizeof(char)); cout << "Lecture caractere: '" << c << "' " << endl; int n; Read(fD,&n,sizeof(int)); cout << "Lecture entier: " << n < n+1 espaces reserves Read(fD,Tab,n); for(int i=0;iAReserver) { n-=AReserver; NbLus=Read(fD, Tab, AReserver); Tab[NbLus]='\0'; cout << Tab; } NbLus=Read(fD, Tab, n); Tab[NbLus]='\0'; cout << Tab; cout<< " '"<0) { Tab[NbLus]='\0'; cout << Tab; } cout << flush; /************************************************************************************/ cout << "' "<< endl<<"et le traitement est fini, au revoir.\n"; Close(fD); return 0; } catch (const CExc & Exc) { cerr <