#include<stdio.h>
#include<fcntl.h>
int openf(char *);
int main(int argc, char * argv[])
{
int fd,fd1, pos,i=1000000;
char ch=”;
fd = openf(argv[1]);
pos = lseek(fd,i * 4096, SEEK_SET);
write(fd, &ch,1);
close(fd);
}
int openf(char * s)
{
int fd;
fd = open(s,O_RDWR|O_CREAT,0666);
if(fd < 1)
perror(“open error”);
else
printf(“input file open succesfull fd = %d\n”,fd);
return fd;
}