Hi,

I have a large file (well 17mb) and I want to randomise the lines in the file. The process I have loads the file, creates a file pointer list pointing to the first character of each line, randomisies the list of file pointers then loads each line and places it into a new text file.

The problem section is the loading each line and placing it into a new text file. I use fseek() to find each line from the randomised list and fgets() to load the line into a buffer.

Under unix (AIX) this process runs in less than 30 seconds. On Windows it is now taking more than 30 minutes. Upon removing the fseek and just loading each line in order under windows it takes less than 30 seconds. I tried to use fsetpos instead of fseek and it makes no difference.

I'm using Borland Development Studio 2006 which uses the Dinkumware compiler. This section of code is very old, and unfortunately not written by me but it is using old C style function to laod the data and write to the files and I do not have the time frame to fix that.

Anyone have any idea why it might take so long to run when I'm seeking to a new line on Windows and run so **** fast on Unix?

Cheers
Dan