LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain the file length of a file larger than 4G

I would like to obtain the file length of a file larger than 4GB.
I am using CVI 6.0 under XP

The only function I have found "GetFileSizeEx()" from the SDK but always returns with an error (error #6 "The handle is invalid".)

LARGE_INTEGER FileSize ;
double Size ;
#define E32 4294967296.0 //2^32

fp = fopen( File,"rb" ) ;
ret=GetFileSizeEx (fp, &FileSize) ;

Size = FileSize.HighPart*E32 + FileSize.LowPart ;

Does anybody know a working method under CVI?
0 Kudos
Message 1 of 3
(3,318 Views)
I will try to pass a handle created by a SDK function like CreateFile: I guess you cannot pass handles created by standard C functions to SDK functions.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,314 Views)
Thanks a lot Roberto, it is working fine now!!!
0 Kudos
Message 3 of 3
(3,293 Views)