File transfer over TCP

Blitz3D Forums/Blitz3D Beginners Area/File transfer over TCP

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

cool, im gonna need that for the next part of my project. i quickly wrote something to see if i could copy a file and it works but i dont know why it works..



size=16384
bank=CreateBank(size)
filein=ReadFile("C:\The reelists feat.Miss Dynamite - Back to life (One Love Album).mp3")
fileout=WriteFile("C:\The reelists feat.Miss Dynamite - Back to life (One Love Album) copy.mp3")

While Not Eof(filein)
ReadBytes bank,filein,0,size
WriteBytes bank,fileout,0,size
Wend

FreeBank bank
CloseFile filein
CloseFile fileout
End


The file gets copied and works just like the original. i want to know why this is working because it looks like im only reading bytes 0 to 16384 every loop..

Am i right in thinking that every time a chunk is read from a file, the pointer in the file automatically moves to the end of that chunk read?

**** EDIT ****

the above code is correct.