fork download
  1. #include<fcntl.h>
  2. #include<unistd.h>
  3. int main(int argc,char**argy)
  4. {
  5. char buf;int size,fd;
  6. fd=open(argy[1],O_RDONLY);
  7. size=lseek(fd,-1,SEEK_END);
  8. while(size-->=0)
  9. {
  10. read(fd,&buf,1);
  11. write(STDOUT_FILENO,&buf,1);
  12. lseek(fd,-2,SEEK_CUR);
  13. }
  14. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty