aboutsummaryrefslogtreecommitdiff
path: root/c10/ex01/main.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-16 12:58:13 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-16 12:58:13 +0200
commit14914f50c3de6c5444e13cf67db064b03c1c90ef (patch)
tree3ecf5a41b4541980ba0287a431681cd5ae25ad84 /c10/ex01/main.c
parent217bcb0d4e3ba60604921cb40d5a11a64f93cfc7 (diff)
downloadpiscine-14914f50c3de6c5444e13cf67db064b03c1c90ef.tar.gz
piscine-14914f50c3de6c5444e13cf67db064b03c1c90ef.tar.bz2
piscine-14914f50c3de6c5444e13cf67db064b03c1c90ef.zip
c09 passed, c10 start, exam00 and exam01
Diffstat (limited to 'c10/ex01/main.c')
-rw-r--r--c10/ex01/main.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/c10/ex01/main.c b/c10/ex01/main.c
new file mode 100644
index 0000000..b5fb416
--- /dev/null
+++ b/c10/ex01/main.c
@@ -0,0 +1,34 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/15 16:45:20 by cacharle #+# #+# */
+/* Updated: 2019/07/16 10:20:39 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include <unistd.h>
+#include "include.h"
+
+int main(int argc, char **argv)
+{
+ int i;
+ int fildes;
+ int status;
+
+ status = 0;
+ i = 1;
+ while (i < argc)
+ {
+ if (print_file(argv[i]) == -1)
+ {
+ handle_error(argv[0], argv[i]);
+ status = 1;
+ }
+ i++;
+ }
+ return (status);
+}