Click to See Complete Forum and Search --> : Reading a specific part of a file


Cakkie
January 31st, 2000, 12:02 PM
Is it possible to read just a part of a file, without having to read the entire file. For example, I just need bytes 1700 trough 1800 from myProgram.exe. This is not a database file, nor a ascii file.
Also, when the read is done, the file should be closed so other instances of the program can acces the file anywhere they want.

This is for sending files across a network. It must be possible to send the same file at the same time to multiple receivers, even when someone requests the file when it is already beeing sent to someone else (like 70% complete)

Reznor_X
January 31st, 2000, 02:36 PM
haven't done it before, but maybe you can use something like this :


dim myByte as Byte
dim iFile as Integer

iFile=FreeFile

Open "myfile.dat" for bynary as #iFile

'use seek to position at the desired address
'use input to read the amount of bytes

Close #iFile





i'll give it a try, If I come up with something I'll let ya know... in the mean time, check those functions (input, seek)