{"action":"opened","issue":{"url":"https://api.github.com/repos/sebastiandev/zipper/issues/4","repository_url":"https://api.github.com/repos/sebastiandev/zipper","labels_url":"https://api.github.com/repos/sebastiandev/zipper/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/sebastiandev/zipper/issues/4/comments","events_url":"https://api.github.com/repos/sebastiandev/zipper/issues/4/events","html_url":"https://github.com/sebastiandev/zipper/issues/4","id":162138081,"number":4,"title":"Failing to archive binary files","user":{"login":"alexbala","id":20127591,"avatar_url":"https://avatars.githubusercontent.com/u/20127591?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbala","html_url":"https://github.com/alexbala","followers_url":"https://api.github.com/users/alexbala/followers","following_url":"https://api.github.com/users/alexbala/following{/other_user}","gists_url":"https://api.github.com/users/alexbala/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbala/subscriptions","organizations_url":"https://api.github.com/users/alexbala/orgs","repos_url":"https://api.github.com/users/alexbala/repos","events_url":"https://api.github.com/users/alexbala/events{/privacy}","received_events_url":"https://api.github.com/users/alexbala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-24T12:37:32Z","updated_at":"2016-06-24T12:37:32Z","closed_at":null,"body":"Hi Sebastian,\r\n\r\nI compiled your code in VS2015 after I've made the changes Antony007 said about in the issue he opened. \r\nIt's working properly (compressing and uncompressing) for text files, but I had problems whenever I chose files like dlls, libs, exes, chms, etc. They were incomplete (much smaller in size) after archive.\r\nI've made it working by specifying the 'binary' flag when you create the ifstreams and ofstreams:\r\n\r\n```\r\nbool Zipper::add(const std::string& fileOrFolderPath, zipFlags flags)\r\n{\r\n   ...\r\n   std::ifstream input(f, std::ifstream::binary);\r\n   ...\r\n   std::ifstream input(fileOrFolderPath, std::ifstream::binary);\r\n   ...\r\n}\r\n```\r\n\r\nand\r\n```\r\n\r\nint extractToFile(const std::string& filename, ZipEntry& info)\r\n{\r\n   ...\r\n   std::ofstream output_file(filename, std::ofstream::binary);\r\n   ...\r\n}\r\n```\r\n\r\nMaybe you could test it for binary files too and make the necessary modificationsif it doesn't work on VS2013."}}
{"actor":{"display_login":"alexbala"}}