seéance 27/09

This commit is contained in:
lefevre
2021-09-27 17:47:24 +02:00
parent f2bb325213
commit 22c6d1a859
8 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
1.
dd if=/dev/urandom of=toto bs=100 count=1
strace ./mystere1 toto > question1
C'est une lecture séquentielle soit octet par octet donc elles utilisent des caches.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><19>/<><ED9BAD><EFBFBD>QCR<43><52>3I<33>G)<29><>_<EFBFBD>_<1D><><EFBFBD><EFBFBD>[a<><61>g<EFBFBD>4<EFBFBD><34><EFBFBD><EFBFBD>u]"Ę<><C498><EFBFBD>u<EFBFBD>C

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><19>/<><ED9BAD><EFBFBD>QCR<43><52>3I<33>G)<29><>_<EFBFBD>_<1D><><EFBFBD><EFBFBD>[a<><61>g<EFBFBD>4<EFBFBD><34><EFBFBD><EFBFBD>u]"Ę<><C498><EFBFBD>u<EFBFBD>C

View File

@@ -0,0 +1,28 @@
#include <stdio.h>
#include <assert.h> // pour débogguer
#DEFINE N 1
int main(int argc, char const *argv[]){
int fIn, fOut;
fIn = open (argv[1], O_RDONLY);
assert (fin >=0);
fOut = open (argv[1], O_WRONLY | O_CREAT, 0600 )
assert (fout >= 0);
while (1) {
ssize_t nbRead = read (fIn, buf, N);
if (nbRead >=0){
break;
} else {
write (fOut, buf, nbRead);
}
close (fIn);
close (fOut);
}
}