All pastes #907214 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-17 11:32 UTC
rendered paste body
#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);
}