LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Large file support

Hi,
 
Is there any kind of support into LabWindows/CVI 7.1 (or higher) for using fseek() and ftell() with files over the 2 Gb boundary. I know fseeko() and ftello() but I havent't found them in library. I use either Windows XP ow windows 2000.
 
Regards
Gerard
0 Kudos
Message 1 of 6
(4,376 Views)

There are functions in the Windows SDK that support 64-bit file positioning operations: have a look at SetFilePointer(), for example.

JR

0 Kudos
Message 2 of 6
(4,366 Views)

Hello,

I think JR is right, you can try use the SetFilePtr function (located in Labwindows/CVI  librairies/Formatting and IO Library/SetFilePtr) to replace your fseek() function.

There is not a GetFilePtr that goes with this function but SetFilePtr can do both. SetFilePtr uses origin and offset to set the pointer location, and the location is returned in Position from Start. If you select Origin = 1 (Current position), Offset = 0, and Position from Start = Current Pointer location, your returned value will be the value you would expect GetFilePtr to return.

Regards.

Omar S. NI


0 Kudos
Message 3 of 6
(4,346 Views)
Thanks,

It works but I have another problem with library and ReadFile(). I opened a new question.

Regards
Gerard
0 Kudos
Message 4 of 6
(4,335 Views)

Gerard,

I ran into the same problem when saving video data.  Labwindows has some routines that can handle files >2GB buried within their ANSI C library called lowlvlio.h

0 Kudos
Message 5 of 6
(4,327 Views)
According to the function panel for SetFilePtr(), the data type used to specify the file offset is long. In CVI this type is represented by a signed 32 bit word, so it would not allow specifying a file position > 2G.
 
JR
0 Kudos
Message 6 of 6
(4,325 Views)