Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/nweb/
Upload File :
Current File : /var/www/html/mmishra/nweb/fileread.c

#include <stdio.h>
#include <fcntl.h>

main(int argc, char * argv[])
{
  char *buf;
  int bytesRead;
  int fp;
  fp = open("test.htm", O_RDWR);
  do{
    bytesRead = read(fp, buf, 1);
    printf("%d%s", bytesRead,buf);
    }
  while(bytesRead != 0);
  close(fp);

  //exit(0);
}
/*
#include <stdio.h>
int main()
{
   FILE *fopen(), *fp;
   int c;
   fp = fopen("TENLINES.TXT","r");
   c = getc(fp) ;
   while (c!= EOF)
   {
   		putchar(c);
		c = getc(fp);
   }
   fclose(fp);
}
*/