/* fix bugs : change kindm from 0034 to 1027 */ #include #include #include main() { char file[20],buf[9]; int fd; buf[8]='\0'; while ( scanf("%s",file) != EOF ) { fd = open(file, O_RDWR, 0); if (fd == -1) { printf("file open error %d\n",file); continue; } /* lseek(fd, 0L, 0); read (fd, buf, 8); printf("%s\n",buf); */ lseek(fd, 0L, 0); write(fd, " 1027", 8); close (fd); } }