2021-01-18 00:20:58 +00:00
|
|
|
int :: open(char* pathname, int flags);
|
|
|
|
int :: read(int fd, char* buffer, int size);
|
|
|
|
int :: write(int fd, void* buffer, int size);
|
|
|
|
int :: close(int fd);
|
|
|
|
|
|
|
|
char* textbuffer;
|
|
|
|
|
|
|
|
int :: main() {
|
2022-03-03 00:05:10 +00:00
|
|
|
long sourcefile;
|
|
|
|
long count;
|
2021-01-18 00:20:58 +00:00
|
|
|
|
|
|
|
textbuffer = " ";
|
|
|
|
|
2021-01-18 01:47:42 +00:00
|
|
|
sourcefile = open("tests/cat.er", 0);
|
2021-01-18 00:20:58 +00:00
|
|
|
if(sourcefile =? -1) {
|
|
|
|
return (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
while((count = read(sourcefile, textbuffer, 60)) > 0) {
|
|
|
|
write(1, textbuffer, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
close(sourcefile);
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|