I have some code that executes the command unzip -p myzip.zip picture.png that prints out the “binary” data of picture.png. If it’s saved with the correct extension, upon opening it it gives an error saying the file is corrupt. So my question is what is the proper way to write this data to a file using cocoa? Right now Im just using [data writeToFile:@"/picture.png" atomically:NO];. I know binary is supposed to be 1’s and 0’s but it gives “binary” code like this:
?VaE?.?_QA?J+G:'GD?{C??!? ??٬?d?V ?E?e???8^?t?-P?ʍ?psq???N?S:????,l^&?,_."? ??!a?Y`?,?-??.I ?ILD]?Ҙ佊??????????FLߊŜ?D??Y%?@O?#/??#
After reading through the extremely long
manpage for the 3rd time, I found out a better way to accomplish it, using the-dargument.