分类: C/C++
2010-08-26 12:43:29
#include
#include
#include
#include
#include
int main (int argc,char* argv[]){
int fd;
if((fd = creat("file.hole",O_CREAT))<0)
perror("creat error!!");
if(write(fd,"abcdefghij",10)!=10)
perror("wirte error!!");
if(lseek(fd,40,SEEK_SET)==-1)
perror("lseek error!!!");
if(write(fd,"ABCEDFGHIJ",10)!=10)
perror("wirte2 error!!");
return 0;
}