#include #include #include #include #include #include int main(int argc, char **argv) { int o; char *buffer="AAAA"; if ( -1 == ( o = open( argv[1], O_WRONLY|O_CREAT, 0666))) { perror("open"); return 1; } if ( -1 == lseek (o, (off_t) atol(argv[2]) - 4, SEEK_SET)) perror("lseek"); write( o, buffer, 4 ); close(o); }