hi

i am writing a programm that splits large text files (2gb+). what i am doing for now is that i reads and copy the file to a new one till i found a special marker in the text and then close the outputfile and open a new one and so on. something like:
[CODE]
while(~EOF) {
fopen(myfile.....);
while(marker not found) {
fputc(fgetc(source),newfile);
}
}

Problem, while performing on the file, i need twice the size of the file. isn't there a way to get the position where to split and the simply dividing a large file in two without copying?

thanks