-
Notifications
You must be signed in to change notification settings - Fork 0
/
1-main.c
31 lines (29 loc) · 802 Bytes
/
1-main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <stdlib.h>
#include "main.h"
/**
* main - check the code
*
* Return: Always 0.
*/
int main(int ac, char **av)
{
int res;
if (ac != 3)
{
dprintf(2, "Usage: %s filename text\n", av[0]);
exit(1);
}
res = create_file(av[1], av[2]);
printf("-> %i)\n", res);
return (0);
}
/*
julien@ubuntu:~/0x15. File descriptors and permissions$ gcc -Wall -pedantic -Werror -Wextra -std=gnu89 1-main.c 1-create_file.c -o b
julien@ubuntu:~/0x15. File descriptors and permissions$ ./b hello world
-> 1)
julien@ubuntu:~/0x15. File descriptors and permissions$ ls -l hello
-rw------- 1 julien julien 5 Dec 3 14:28 hello
julien@ubuntu:~/0x15. File descriptors and permissions$ cat hello
worldjulien@ubuntu:~/0x15. File descriptors and permis$
*/