diff --git a/1A/Algo/tp/C/tp7/MacOSX15.5.sdk b/1A/Algo/tp/C/tp7/MacOSX15.5.sdk deleted file mode 120000 index 1ce0f37..0000000 --- a/1A/Algo/tp/C/tp7/MacOSX15.5.sdk +++ /dev/null @@ -1 +0,0 @@ -MacOSX.sdk \ No newline at end of file diff --git a/2A/Anglais/Orale.docx b/2A/Anglais/Orale.docx new file mode 100644 index 0000000..90e84c9 Binary files /dev/null and b/2A/Anglais/Orale.docx differ diff --git a/2A/PPP/s1/Communication_professionnelle/LettreMotivationSTM.pdf b/2A/PPP/s1/Communication_professionnelle/LettreMotivation.pdf similarity index 75% rename from 2A/PPP/s1/Communication_professionnelle/LettreMotivationSTM.pdf rename to 2A/PPP/s1/Communication_professionnelle/LettreMotivation.pdf index f3615e6..a72807a 100644 Binary files a/2A/PPP/s1/Communication_professionnelle/LettreMotivationSTM.pdf and b/2A/PPP/s1/Communication_professionnelle/LettreMotivation.pdf differ diff --git a/2A/PPP/s1/PPP/10conseilsPPP.docx b/2A/PPP/s1/PPP/10conseilsPPP.docx new file mode 100644 index 0000000..d5f4684 Binary files /dev/null and b/2A/PPP/s1/PPP/10conseilsPPP.docx differ diff --git a/2A/systeme/tp/2_tp/ex1 b/2A/systeme/tp/2_tp/ex1 new file mode 100755 index 0000000..3651936 Binary files /dev/null and b/2A/systeme/tp/2_tp/ex1 differ diff --git a/2A/systeme/tp/2_tp/ex1.c b/2A/systeme/tp/2_tp/ex1.c new file mode 100644 index 0000000..65f44a1 --- /dev/null +++ b/2A/systeme/tp/2_tp/ex1.c @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +void showFileInfos(char *fileName) { + struct stat infos; + + if (stat(fileName, &infos) == -1) { + perror("stat"); + exit(EXIT_SUCCESS); + } + + printf("Nom : %s\nTaille en octets : %lld octets\nDate modif : %lld s\n", \ + fileName, (long long) infos.st_size, (long long) infos.st_mtime); + +} + +int main(int argc, char* argv[]) +{ + if(argc != 2){ + fprintf(stderr, "Usage : %s \n", argv[0]); + exit(EXIT_FAILURE); + } + + showFileInfos(argv[1]); + + return 0; +} \ No newline at end of file diff --git a/2A/systeme/tp/2_tp/ex2 b/2A/systeme/tp/2_tp/ex2 new file mode 100755 index 0000000..7ddc427 Binary files /dev/null and b/2A/systeme/tp/2_tp/ex2 differ diff --git a/2A/systeme/tp/2_tp/ex2.c b/2A/systeme/tp/2_tp/ex2.c new file mode 100644 index 0000000..d551e96 --- /dev/null +++ b/2A/systeme/tp/2_tp/ex2.c @@ -0,0 +1,52 @@ +#include +#include +#include +#include +#include +#include +#include + +void showFileInfos(char *fileName) { + struct stat infos; + + if (stat(fileName, &infos) == -1) { + perror("stat"); + exit(EXIT_SUCCESS); + } + + printf("Nom : %s\nTaille en octets : %lld octets\nDate modif : %lld s\n", \ + fileName, (long long) infos.st_size, (long long) infos.st_mtime); + +} + +// affiche tout les fichiers dans son rep par ordre de création +void listDirContent(char *dirName){ + DIR *dir; + struct dirent *dp; + + if((dir=opendir(dirName)) == NULL){ + perror("opendir"); + exit(errno); + } + + while((dp =readdir(dir)) != NULL) { + printf("%s\n", dp->d_name); + } + + printf("\n"); + + closedir(dir); +} + +int main(int argc, char* argv[]) +{ + if(argc != 2){ + fprintf(stderr, "Usage : %s \n", argv[0]); + exit(EXIT_FAILURE); + } + + // showFileInfos(argv[1]); + listDirContent(argv[1]); + + return 0; +} \ No newline at end of file diff --git a/2A/systeme/tp/2_tp/ex3 b/2A/systeme/tp/2_tp/ex3 new file mode 100755 index 0000000..fdaa0ef Binary files /dev/null and b/2A/systeme/tp/2_tp/ex3 differ diff --git a/2A/systeme/tp/2_tp/ex3.c b/2A/systeme/tp/2_tp/ex3.c new file mode 100644 index 0000000..880d8c4 --- /dev/null +++ b/2A/systeme/tp/2_tp/ex3.c @@ -0,0 +1,88 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +void showFileInfos(char *fileName) { + struct stat infos; + + if (stat(fileName, &infos) == -1) { + perror("stat"); + exit(EXIT_SUCCESS); + } + + printf("Nom : %s\nTaille en octets : %lld octets\nDate modif : %lld s\n\n", \ + fileName, (long long) infos.st_size, (long long) infos.st_mtime); + +} + +// affiche tout les fichiers dans son rep par ordre de création +int listDirContent(char *dirName){ + DIR *dir; + int len; + struct dirent *dp; + + if((dir=opendir(dirName)) == NULL){ + perror("opendir"); + exit(errno); + } + + while((dp =readdir(dir)) != NULL) { + printf("%s\n", dp->d_name); + } + + printf("\n"); + + closedir(dir); + return 0; +} + +int showDir(char *dirName){ + DIR *dir; + int len = strlen(dirName); + struct dirent *dp; + + if((dir=opendir(dirName)) == NULL){ + perror("opendir"); + exit(errno); + } + + while((dp =readdir(dir)) != NULL) { + char * path; // dirName + / + dp->d_name + + if((path=malloc(len+strlen(dp->d_name)+2)) == NULL){ + perror("malloc"); + exit(errno); + } + + strcpy(path, dirName); + strcat(path, "/"); + strcat(path, dp->d_name); + + showFileInfos(path); + + free(path); + } + + closedir(dir); + return 0; +} + +int main(int argc, char* argv[]) +{ + int rep; + if(argc != 2){ + fprintf(stderr, "Usage : %s \n", argv[0]); + exit(EXIT_FAILURE); + } + + // showFileInfos(argv[1]); + // listDirContent(argv[1]); + rep = showDir(argv[1]); + + return 0; +} \ No newline at end of file diff --git a/2A/systeme/tp/2_tp/ex4 b/2A/systeme/tp/2_tp/ex4 new file mode 100755 index 0000000..a04bb60 Binary files /dev/null and b/2A/systeme/tp/2_tp/ex4 differ diff --git a/2A/systeme/tp/2_tp/ex4.c b/2A/systeme/tp/2_tp/ex4.c new file mode 100644 index 0000000..9c20116 --- /dev/null +++ b/2A/systeme/tp/2_tp/ex4.c @@ -0,0 +1,97 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +void showFileInfos(char *fileName) { + struct stat infos; + + if (stat(fileName, &infos) == -1) { + perror("stat "); + exit(EXIT_SUCCESS); + } + + printf("Nom : %s\nTaille en octets : %lld octets\nDate modif : %lld s\n\n", \ + fileName, (long long) infos.st_size, (long long) infos.st_mtime); + +} + +// affiche tout les fichiers dans son rep par ordre de création +int listDirContent(char *dirName){ + DIR *dir; + int len; + struct dirent *dp; + + if((dir=opendir(dirName)) == NULL){ + perror("opendir"); + exit(errno); + } + + while((dp =readdir(dir)) != NULL) { + printf("%s\n", dp->d_name); + } + + printf("\n"); + + closedir(dir); + return 0; +} + +int showDir(char *dirName){ + DIR *dir; + int len = strlen(dirName); + struct dirent *dp; + int rep; + + if((dir=opendir(dirName)) == NULL){ + perror("opendir"); + exit(errno); + } + + showFileInfos(dirName); + + while((dp =readdir(dir)) != NULL) { + char * path; // dirName + / + dp->d_name + + if(strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0){ + continue; //passe au tour de boucle suivant + } + + if((path=malloc(len+strlen(dp->d_name)+2)) == NULL){ + perror("malloc"); + exit(errno); + } + + strcpy(path, dirName); + strcat(path, "/"); + strcat(path, dp->d_name); + + if(dp->d_type == DT_DIR) { + rep = showDir(path); + } + else showFileInfos(path); + + free(path); + } + + closedir(dir); + return 0; +} + +int main(int argc, char* argv[]) +{ + int rep; + if(argc != 2){ + fprintf(stderr, "Usage : %s \n", argv[0]); + exit(EXIT_FAILURE); + } + + rep = showDir(argv[1]); + + return 0; +} +// si rep et != . et .. \ No newline at end of file