seéance 27/09
This commit is contained in:
parent
f2bb325213
commit
22c6d1a859
7
ASR3.1/TP02 Fichier/TP02.txt
Normal file
7
ASR3.1/TP02 Fichier/TP02.txt
Normal 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.
|
BIN
ASR3.1/TP02 Fichier/exercice1/mystere1
Executable file
BIN
ASR3.1/TP02 Fichier/exercice1/mystere1
Executable file
Binary file not shown.
BIN
ASR3.1/TP02 Fichier/exercice1/mystere2
Normal file
BIN
ASR3.1/TP02 Fichier/exercice1/mystere2
Normal file
Binary file not shown.
BIN
ASR3.1/TP02 Fichier/exercice1/mystere3
Normal file
BIN
ASR3.1/TP02 Fichier/exercice1/mystere3
Normal file
Binary file not shown.
BIN
ASR3.1/TP02 Fichier/exercice1/mystere4
Normal file
BIN
ASR3.1/TP02 Fichier/exercice1/mystere4
Normal file
Binary file not shown.
1
ASR3.1/TP02 Fichier/exercice1/question1
Normal file
1
ASR3.1/TP02 Fichier/exercice1/question1
Normal file
@ -0,0 +1 @@
|
||||
‰ϊΫ/훦ƒΤQCR«ϊ3IχG)ιΧ_<CEA7>_‰<>Εκ[aµφg4“ ²Νu]"Δ<>Ιη‚u•C
<0A>'§Λbσ&·ZZ%°’·φ®<CF86>[„Ψ―Χ<E28095>θη6να"1Bύ†ΒaψJΪσ Ι
|
1
ASR3.1/TP02 Fichier/exercice1/toto
Normal file
1
ASR3.1/TP02 Fichier/exercice1/toto
Normal file
@ -0,0 +1 @@
|
||||
‰ϊΫ/훦ƒΤQCR«ϊ3IχG)ιΧ_<CEA7>_‰<>Εκ[aµφg4“ ²Νu]"Δ<>Ιη‚u•C
<0A>'§Λbσ&·ZZ%°’·φ®<CF86>[„Ψ―Χ<E28095>θη6να"1Bύ†ΒaψJΪσ Ι
|
28
ASR3.1/TP02 Fichier/exercice2.c
Normal file
28
ASR3.1/TP02 Fichier/exercice2.c
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user