For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > April 2005 > Alternative to the file Get statement for large files









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Alternative to the file Get statement for large files
Ed

2005-04-26, 8:56 am


Hi, I'm trying to read parts of a file which is about 4GB using VB6. Using
the Get statement

Get [#]filenumber, [recnumber], varname

I soon run into problems. The recnumber is a long which only works up to
roughly 2GB. How can I read a section of the file starting, lets say, around
3GB? I assume I will have to use an alternative to the Get statement. Any
ideas?


Best regards,

Ed


J French

2005-04-26, 8:56 am

On Tue, 26 Apr 2005 08:43:32 +0200, "Ed" <abcdef@hotmail.com> wrote:

>
>Hi, I'm trying to read parts of a file which is about 4GB using VB6. Using
>the Get statement
>
>Get [#]filenumber, [recnumber], varname
>
>I soon run into problems. The recnumber is a long which only works up to
>roughly 2GB. How can I read a section of the file starting, lets say, around
>3GB? I assume I will have to use an alternative to the Get statement. Any
>ideas?


I honestly think that you'll need to use the APIs to access over 2gb

CreateFile, SetFilePointer etc
Thorsten Albers

2005-04-26, 3:56 pm

Ed <abcdef@hotmail.com> schrieb im Beitrag
<uP9zEtiSFHA.1348@TK2MSFTNGP15.phx.gbl>...
> Hi, I'm trying to read parts of a file which is about 4GB using VB6.

Using
> the Get statement
> Get [#]filenumber, [recnumber], varname
> I soon run into problems. The recnumber is a long which only works up to
> roughly 2GB. How can I read a section of the file starting, lets say,

around
> 3GB? I assume I will have to use an alternative to the Get statement. Any


> ideas?


You will have to use the respective API functions like CreateFile(),
ReadFile(), WriteFile(), and CloseHandle().

--
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------

TC

2005-04-27, 8:55 am

There was an MSDN article on how to manage large files from VB[A] using
the win32 API's createfile, setfilepointer etc. Unfortunately I ca not
find it right now, & I have to go from this pc! Do some googling & you
may be able to find it.

HTH,
TC

Sam Hobbs

2005-04-28, 3:56 am

"TC" <aatcbbtccctc@yahoo.com> wrote in message
news:1114583707.634016.118960@o13g2000cwo.googlegroups.com...
> There was an MSDN article on how to manage large files from VB[A] using
> the win32 API's createfile, setfilepointer etc. Unfortunately I ca not
> find it right now, & I have to go from this pc! Do some googling & you
> may be able to find it.


KB "HOWTO: Write Data to a File Using WriteFile APIVB" (165942) might help,
but I assume there are many other samples in many of the other great sites
with VB samples.

My point is that sometimes people assume that the KB won't help and that it
is only the other sites that can help.


Sam Hobbs

2005-04-28, 3:56 am

"Ed" <abcdef@hotmail.com> wrote in message
news:uP9zEtiSFHA.1348@TK2MSFTNGP15.phx.gbl...
>
> Hi, I'm trying to read parts of a file which is about 4GB using VB6. Using
> the Get statement
>
> Get [#]filenumber, [recnumber], varname
>
> I soon run into problems. The recnumber is a long which only works up to
> roughly 2GB. How can I read a section of the file starting, lets say,
> around 3GB? I assume I will have to use an alternative to the Get
> statement. Any ideas?


If you search the internet using something such as:

declare +CreateFilea

You should be able to find many useful samples and such.


J French

2005-04-28, 3:56 am

On Wed, 27 Apr 2005 17:13:01 -0700, "Sam Hobbs"
<samuel@social.rr.com_change_social_to_socal> wrote:

<snip>

>If you search the internet using something such as:
>
> declare +CreateFilea
>
>You should be able to find many useful samples and such.


But the first place to start is the downloadable API Guide from KPD

http://www.mentalis.org/agnet/

Then look at the examples for CreateFile

TC

2005-04-28, 8:55 am

Nearly, but not quite!

There was one that provided "large" equivalents of all of the relevant
primitives: Read, Write, S, etc.

Stuffed if I can find it now :-(

Cheers,
TC

Ed

2005-04-28, 3:57 pm

Figured it out using API. Thanks for your help.

Ed


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com