diff --git a/ASR3.1/TP02 Fichier/TP02.txt b/ASR3.1/TP02 Fichier/TP02.txt new file mode 100644 index 0000000..3afdac8 --- /dev/null +++ b/ASR3.1/TP02 Fichier/TP02.txt @@ -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. \ No newline at end of file diff --git a/ASR3.1/TP02 Fichier/exercice1/mystere1 b/ASR3.1/TP02 Fichier/exercice1/mystere1 new file mode 100755 index 0000000..927a64a Binary files /dev/null and b/ASR3.1/TP02 Fichier/exercice1/mystere1 differ diff --git a/ASR3.1/TP02 Fichier/exercice1/mystere2 b/ASR3.1/TP02 Fichier/exercice1/mystere2 new file mode 100644 index 0000000..25f20f7 Binary files /dev/null and b/ASR3.1/TP02 Fichier/exercice1/mystere2 differ diff --git a/ASR3.1/TP02 Fichier/exercice1/mystere3 b/ASR3.1/TP02 Fichier/exercice1/mystere3 new file mode 100644 index 0000000..84ac14f Binary files /dev/null and b/ASR3.1/TP02 Fichier/exercice1/mystere3 differ diff --git a/ASR3.1/TP02 Fichier/exercice1/mystere4 b/ASR3.1/TP02 Fichier/exercice1/mystere4 new file mode 100644 index 0000000..8529a33 Binary files /dev/null and b/ASR3.1/TP02 Fichier/exercice1/mystere4 differ diff --git a/ASR3.1/TP02 Fichier/exercice1/question1 b/ASR3.1/TP02 Fichier/exercice1/question1 new file mode 100644 index 0000000..d014ffb --- /dev/null +++ b/ASR3.1/TP02 Fichier/exercice1/question1 @@ -0,0 +1 @@ +‰úÛ/í›­¦ƒÔQCR«ú3I÷G)é×_Š_‰žÅê[aµög­4“ ²Íu]"ĘÉç‚u•C œ'§Ëbó&·ZZ%°’·ö®œ[„دךèç6íá"1B ý†ÂaøJÚó É \ No newline at end of file diff --git a/ASR3.1/TP02 Fichier/exercice1/toto b/ASR3.1/TP02 Fichier/exercice1/toto new file mode 100644 index 0000000..d014ffb --- /dev/null +++ b/ASR3.1/TP02 Fichier/exercice1/toto @@ -0,0 +1 @@ +‰úÛ/í›­¦ƒÔQCR«ú3I÷G)é×_Š_‰žÅê[aµög­4“ ²Íu]"ĘÉç‚u•C œ'§Ëbó&·ZZ%°’·ö®œ[„دךèç6íá"1B ý†ÂaøJÚó É \ No newline at end of file diff --git a/ASR3.1/TP02 Fichier/exercice2.c b/ASR3.1/TP02 Fichier/exercice2.c new file mode 100644 index 0000000..08784ca --- /dev/null +++ b/ASR3.1/TP02 Fichier/exercice2.c @@ -0,0 +1,28 @@ +#include +#include // 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); + + } + +} \ No newline at end of file