LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

eof has reached maximum file size, may have limitations?

I'm working with a function in the ANSI C -> Low-Level IO library called eof. This function is a condition in a while loop.

I am attempting to load binary files so I am using eof to detect once i reach the end. for 2 hr long or 4 hr long studies this is no problem the file size is approx 1.5 GB to 2 GB. I recently tried loading a 6.3 GB binary study file and my function immediately detected the end of the file instead of after a set number of iterations. Could this be because this function limits the size of the file you read from? Here is my condition below:

 

while((*numPoints < GRAWCOUNT*READBUFFER) && !eof(readHandle)) 

{

   ...

}

 

 

If eof is reached then you get a return value of a 1 otherwise a 0 is returned. I want to continue the while loop as long as i receive 0's, but this only happens for 2 hr or 4 hr studies. I tried a 15 hr = 6.3 GB study file and it immediately exited the while loop without a single iteration.

My immediate thought is there is a limitation to the size of file you can check.

 

Monil Morar
Control System Engineer
Secure Drilling Services (SDS)
Weatherford │ 16430 Park Ten Place │ Suite 200 │ Houston │ Texas │ 77084
0 Kudos
Message 1 of 2
(3,338 Views)

In a 32 bit environment, the ANSI file functions are limited to 4Gbytes (2^32). If your files can be larger than this, you should look at using the SDK versions instead. If you are unfamiliar with these, start by looking up the help on CreateFile() and go from there.

 

JR

0 Kudos
Message 2 of 2
(3,319 Views)