|
发表于 2004-1-21 12:52:56
|
显示全部楼层
那就创建一个具有空洞的文件。
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <stdio.h>
- int
- main(void)
- {
- int fd;
- if((fd=creat("file.hello",
- S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP))<0) {
- printf("create error\n");
- exit(-1);
- }
- if(lseek(fd,1048576,SEEK_SET)==-1) {
- printf("lseek error\n");
- exit(-1);
- }
- exit(0);
- }
复制代码 |
|