Ok simple question. Google didn't bring up much and I need this.
This is the question: How do I interact with non-text files in a simple console app?
Zssffssz -4 Junior Poster
Recommended Answers
Jump to PostTo copy to another location, open the file in binary mode then read/write 255 bytes at a time until end-of-file is reached. Another way to do it on MS-Windows is call win32 api function
Jump to Post> I want to ether copy it to another location
#include <fstream> int main() { std::ifstream fin( "myfile.dat", ios_base::in|std::ios_base::binary ) ; std::ofstream fout( "myfile.cpy", ios_base::out|std::ios_base::binary ) ; fout << fin.rdbuf() ; }
> or (more likely) send it through zlib's deflate.
Simplest if you use a …
All 5 Replies
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Zssffssz -4 Junior Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
vijayan121 1,152 Posting Virtuoso
Ancient Dragon commented: good suggestions :) +17
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.