Im trying to segment a big file (200mb) into smaller packets so i can transmit over TCP/IP but im clueless how to do it. Can anyone help me please. Using the borland builder


If you know how to do file i/o (reads and writes) then the problem is pretty simple. Just open the main file for reading (binary mode) then create a series of small files (open them only one at a time) that will store XXX number of bytes. When the output file contains the desired number of bytes, close it and open another output file. Suggestion: give the names of the output fles some sequential identifier to make it easy for the fella on the other end of the TCP/IP to put the file back together again. For example "file001.txt", "file002.txt" ...

If you do not know how to do file i/o you will need to read a tutorial or text book for introduction.