Hello all,
sorry if I'm making a silly mistake here, but I'm not sure what the best way is.
I'm making a file that has several blocks (at predefined positions). When I create the file, the blocks are not full (i.e. not contiguous). They will be filled later. So, I'd like to skip/extend the file to the position of the next block. Using a seek() and a write just appends and doesn't work.
how do I extend file?
thanks
K
below is the code:
Qt Code:
//make a new file with name in the directory fileName = name;// the file has been opened else return -1; // make a text stream // write the header stream.seek(POS_HEADER); stream << makeHeader(); // write the comments block stream.seek( POS_HEADER_COMMENT); stream << comments;To copy to clipboard, switch view to plain text mode
Bookmarks