I am writing a program that must list and manipulate a large file filesise.

In the past I have used the Adir() or api calls of FindFirst and
FindNext to retrieve the information.

Now, I have run into a problem for the first time. Since I need to list
in a table field, large numbers that exceed the capacity of a 4 byte
integer.

When I test using large > 4 gig, ".avi" file, the values obtained by all
the functions I have tried are incorrect, showing - 2 gig or some other
incorrect value.

I know this is because the number exceeds the storage type capacity.

I have used 8 byte doubles but the routine I have still will not work.

I have tried using the following API call in Kernel32 GetFileSizeEx

BOOL GetFileSizeEx(
HANDLE hFile,
PLARGE_INTEGER lpFileSize
);

Parameters
hFile
[in] Handle to the file whose size is to be returned. The handle must
have been created with either the GENERIC_READ or GENERIC_WRITE access
right. For more information, see File Security and Access Rights.
lpFileSize
[out] Pointer to a LARGE_INTEGER structure that receives the file size.
Return Values
If the function succeeds, the return value is nonzero.


But I cannot get it to work in either VFP8 or in a C DLL I wrote.

Can anyone help with a routine to get these large files sizes into a
program.

There must be a way since many commercial programs do this.

Any and all help appreciated.

Re: How to get and use large file sizes in VFP8 and GetFileSizeEx() by Christian

Christian
Mon Jan 05 05:33:40 CST 2004

Hello,

maybe this page helps:

http://www.news2news.com/vfp/?example=114&function=165

Regards

Christian

"tsmiley" <tsmiley@wowway.com> schrieb im Newsbeitrag
news:Et6dnVnfGcBhl2SiRVn-gg@wideopenwest.com...
> I am writing a program that must list and manipulate a large file
filesise.
>
> In the past I have used the Adir() or api calls of FindFirst and
> FindNext to retrieve the information.
>
> Now, I have run into a problem for the first time. Since I need to list
> in a table field, large numbers that exceed the capacity of a 4 byte
> integer.
>
> When I test using large > 4 gig, ".avi" file, the values obtained by all
> the functions I have tried are incorrect, showing - 2 gig or some other
> incorrect value.
>
> I know this is because the number exceeds the storage type capacity.
>
> I have used 8 byte doubles but the routine I have still will not work.
>
> I have tried using the following API call in Kernel32 GetFileSizeEx
>
> BOOL GetFileSizeEx(
> HANDLE hFile,
> PLARGE_INTEGER lpFileSize
> );
>
> Parameters
> hFile
> [in] Handle to the file whose size is to be returned. The handle must
> have been created with either the GENERIC_READ or GENERIC_WRITE access
> right. For more information, see File Security and Access Rights.
> lpFileSize
> [out] Pointer to a LARGE_INTEGER structure that receives the file size.
> Return Values
> If the function succeeds, the return value is nonzero.
>
>
> But I cannot get it to work in either VFP8 or in a C DLL I wrote.
>
> Can anyone help with a routine to get these large files sizes into a
> program.
>
> There must be a way since many commercial programs do this.
>
> Any and all help appreciated.
>



Re: How to get and use large file sizes in VFP8 and GetFileSizeEx() by tsmiley

tsmiley
Mon Jan 05 06:53:41 CST 2004

Christian

Thank you

I had tried the routine you referenced, with no luck for the last 2
days. But now I simply pasted it in my program and it does work.

All files up to and I believe larger than 2.5 gig ( it works for sure
with a 34 gig files that failed before.

The only problem is with a few files that show up as a negative number
they are all about 2.1 gigs in size, and the routine referenced still
returns -2100000000

perhaps I need to run scan disk or the files are corrupt.

I believe that the problem is in my files or my code, the routine you
supplied reference to works.

This news group is Great, what a fast solution.

Thanks again
Tom Smiley


Christian Ehlscheid wrote:
> Hello,
>
> maybe this page helps:
>
> http://www.news2news.com/vfp/?example=114&function=165
>
> Regards
>
> Christian
>
> "tsmiley" <tsmiley@wowway.com> schrieb im Newsbeitrag
> news:Et6dnVnfGcBhl2SiRVn-gg@wideopenwest.com...
>
>>I am writing a program that must list and manipulate a large file
>
> filesise.
>
>>In the past I have used the Adir() or api calls of FindFirst and
>>FindNext to retrieve the information.
>>
>>Now, I have run into a problem for the first time. Since I need to list
>>in a table field, large numbers that exceed the capacity of a 4 byte
>>integer.
>>
>>When I test using large > 4 gig, ".avi" file, the values obtained by all
>>the functions I have tried are incorrect, showing - 2 gig or some other
>>incorrect value.
>>
>>I know this is because the number exceeds the storage type capacity.
>>
>>I have used 8 byte doubles but the routine I have still will not work.
>>
>>I have tried using the following API call in Kernel32 GetFileSizeEx
>>
>>BOOL GetFileSizeEx(
>> HANDLE hFile,
>> PLARGE_INTEGER lpFileSize
>>);
>>
>>Parameters
>>hFile
>>[in] Handle to the file whose size is to be returned. The handle must
>>have been created with either the GENERIC_READ or GENERIC_WRITE access
>>right. For more information, see File Security and Access Rights.
>>lpFileSize
>>[out] Pointer to a LARGE_INTEGER structure that receives the file size.
>>Return Values
>>If the function succeeds, the return value is nonzero.
>>
>>
>>But I cannot get it to work in either VFP8 or in a C DLL I wrote.
>>
>>Can anyone help with a routine to get these large files sizes into a
>>program.
>>
>>There must be a way since many commercial programs do this.
>>
>>Any and all help appreciated.
>>
>
>
>