944,014 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 919
  • C RSS
Aug 15th, 2006
0

Segmenting a file

Expand Post »
Hello
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

Thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Panda123 is offline Offline
2 posts
since Aug 2006
Aug 15th, 2006
0

Re: Segmenting a file

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.
Last edited by Ancient Dragon; Aug 15th, 2006 at 10:19 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: fread, fwrite issues
Next Thread in C Forum Timeline: socket





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC