#include #include main(int argc, char* argv[]) { char buf[512]={0}; int i; int fd; if ((fd = open("output.cou", O_WRONLY|O_CREAT|O_TRUNC, 0666)) == -1) { perror(NULL); exit(1); } for (i=0;i<5000;i++) { if (argc > 1) { lseek(fd, 0, SEEK_END); } write(fd, buf, sizeof(buf)); } close(fd); }