Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
not needed (use Cat.c instead)
[simgrid.git] / tools / tesh2 / w32 / src / Read.c
diff --git a/tools/tesh2/w32/src/Read.c b/tools/tesh2/w32/src/Read.c
deleted file mode 100644 (file)
index 441c23d..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <fcntl.h>\r
-#include <stdlib.h>\r
-#include <stdio.h>\r
-#include <sys/stat.h>\r
-#include <sys/types.h>\r
-#include <errno.h>\r
-\r
-#ifndef STDOUT_FILENO\r
-#define STDOUT_FILENO  1\r
-#endif\r
-\r
-typedef unsigned char byte_t;\r
-\r
-int\r
-main(int argc, char* argv[])\r
-{\r
-       FILE* stream;\r
-       struct stat s = {0};\r
-       char* buffer;\r
-       int i = 0;\r
-       char c;\r
-       int failed;\r
-\r
-       stream = fopen(argv[1], "r");\r
-\r
-       if(!stream)\r
-       {\r
-               fprintf(stderr, "fopen() failed withe the error %d\n", errno);\r
-               return EXIT_FAILURE;\r
-       }\r
-       \r
-       if(stat(argv[1], &s) < 0)\r
-       {\r
-               fclose(stream);\r
-               fprintf(stderr, "stat() failed withe the error %d\n", errno);\r
-               return EXIT_FAILURE;\r
-       }\r
-       \r
-       \r
-       if(!(buffer = (byte_t*) calloc(s.st_size + 1, sizeof(byte_t))))\r
-       {\r
-               fclose(stream);\r
-               fprintf(stderr, "calloc() failed withe the error %d\n", errno);\r
-               return EXIT_FAILURE;\r
-       }\r
-       \r
-       \r
-       while((c = getc(stream)) != EOF)\r
-               if((int)c != 13)\r
-                       buffer[i++] = c;\r
-       \r
-       failed = ferror(stream);\r
-       \r
-       if(!failed || buffer)\r
-               write(STDOUT_FILENO, buffer, strlen(buffer));\r
-               \r
-       fclose(stream);\r
-       free(buffer);\r
-       \r
-       return failed ? EXIT_FAILURE : EXIT_SUCCESS;\r
-               \r
-}\r
-\r