Segmenting a file

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2006
Posts: 2
Reputation: Panda123 is an unknown quantity at this point 
Solved Threads: 0
Panda123 Panda123 is offline Offline
Newbie Poster

Segmenting a file

 
0
  #1
Aug 15th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,579
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1486
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: Segmenting a file

 
0
  #2
Aug 15th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC