-
Notifications
You must be signed in to change notification settings - Fork 0
/
0-main.c
69 lines (59 loc) · 1.38 KB
/
0-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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <stdio.h>
#include <stdlib.h>
#include "main.h"
/**
* main - check the code
*
* Return: Always 0.
*/
int main(int ac, char **av)
{
ssize_t n;
if (ac != 2)
{
dprintf(2, "Usage: %s filename\n", av[0]);
exit(1);
}
n = read_textfile(av[1], 114);
printf("\n(printed chars: %li)\n", n);
n = read_textfile(av[1], 1024);
printf("\n(printed chars: %li)\n", n);
n = read_textfile(av[1], 0);
printf("\n(printed chars: %li)\n", n);
return (0);
}
/*
julien@ubuntu:~/0x15. File descriptors and permissions$ gcc -Wall -pedantic -Werror -Wextra -std=gnu89 0-main.c 0-read_textfile.c -o a
julien@ubuntu:~/0x15. File descriptors and permissions$ ./a Requiescat
Requiescat
by Oscar Wilde
Tread lightly, she is near
Under the snow,
Speak gently, she can hear
The daisies grow.
(printed chars: 114)
Requiescat
by Oscar Wilde
Tread lightly, she is near
Under the snow,
Speak gently, she can hear
The daisies grow.
All her bright golden hair
Tarnished with rust,
She that was young and fair
Fallen to dust.
Lily-like, white as snow,
She hardly knew
She was a woman, so
Sweetly she grew.
Coffin-board, heavy stone,
Lie on her breast,
I vex my heart alone,
She is at rest.
Peace, Peace, she cannot hear
Lyre or sonnet,
All my life's buried here,
Heap earth upon it.
(printed chars: 468)
julien@ubuntu:~/0x15. File descriptors and permissions$
*/