I’m trying to copy a .tgz file into memory and sending it elsewhere.
Using fopen I get a NULL pointer which tells me that a .tgz file isn’t a binary file, but I was wondering if it is even possible to open, buffer, and pass a .tgz file using C standard libraries and libraries?
Q: Do you want to copy the binary .tgz file as-is? Sure – piece of cake 🙂
Or do you want to interpret the .tgz file, and then copy its contents?
If the latter, I’d look at “zlib”:
A: That tells you no such thing! You should be able to “fopen()” any file … as long as it exists, and as long as you have the correct permissions.
Use “perror()” to find out what the underlying error was.