Link to home
Start Free TrialLog in
Avatar of JBlackham
JBlackham

asked on

File IO

What is the fastest method for accessing information within a file in Visual Basic.  I have tried various methods of opening a file but all of them are extremely slow across a network situation.  I have tried all of the vb calls that are built within.  Is there an api or any faster way to get at data within the files?  

Avatar of YohanShminge
YohanShminge

You're not going to go any faster than your network will allow, no matter what method you choose.  Its going to be limited by the speed and traffic on your network.
Opening what file?
Answer depends on the file type.

and as mentioned above you also have network bottleneck and no matter you use VB or C++

it is there.


As a general rule if the file is a stand alone its better to copy the file to the local computer instead of working with
over the Network.




I don't know which you've tried, but I've found that using

Dim b() as Byte
Get #1, , b()

is much, much, much faster than using

b() = InputB(LOF(1), #1)

I'd say that as a rule, use the Binary Get/Put functions instead of the Input/InputB/Print functions whenever possible.

-Burbble
Maybe if you do the file copy accross the network in two steps

step 1) copy the data across the network store in memory
step 2) write the entire block of data to hard disk in 1 step.



just a suggestion.
Brian
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial