How to break binary file into chunks and store these chunks on file system and again restore it
Hi
By using the C++ programming on windows /Linux, Please suggest way to achieve below functionality:
1. How to break binary file into chunks and store these chunks on the file system
2. And read these chunks from the filesystem
3. and restore the original binary file
Thank You
By using the C++ programming on windows /Linux, Please suggest way to achieve below functionality:
1. How to break binary file into chunks and store these chunks on the file system
2. And read these chunks from the filesystem
3. and restore the original binary file
Thank You
1 Comment
[ + ] Show comment
Answers (2)
Please log in to answer
Posted by:
cbreuer@bscsd.org
8 years ago
Posted by:
anonymous_9363
8 years ago
As per the current implementation, we have read the binary file by using ifstream [binary mode] and break it into the chunks.
And write these chunks on the file system, by using ofstream [binary mode], and while writing the chunks into the single file new line character [\n] is used to between two chunks.
2. And read these chunks from the filesystem
Intermediate file is read by using the ifstream[binary mode] and while retrieving the data (chunks) from the intermediate file in order to get the original data [\n] is checked and skipped.
but in this approach, I think there were some [\n] characters which were exists in the original binary file content are also gets skipped, due to this problem original binary file cannot be created from the intermediate file.
3. and restore the original binary file
Please suggest correct way to write binary chunks in intermediate file and restore it back in original binary contents. - programmer1983 8 years ago