Miscellany
public text v1 · immutable#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
int main(void)
{
int fd,readBytes;
char buff[255];
if( (fd = open("test",O_RDONLY) )<0)
{
perror("error:");
exit(1);
}
while( (readBytes=read(fd,buff,255)) > 0);
//printf("%d %d\n",readBytes,fd);
printf("%s\n",buff);
close(fd);
}