{"id":110,"date":"2008-04-03T14:03:02","date_gmt":"2008-04-03T19:03:02","guid":{"rendered":"http:\/\/stein.everybody.org\/brain\/recursively-expand-compressed-files\/"},"modified":"2011-03-10T10:57:27","modified_gmt":"2011-03-10T15:57:27","slug":"recursively-expand-compressed-files","status":"publish","type":"post","link":"https:\/\/jeremystein.com\/brain\/recursively-expand-compressed-files\/","title":{"rendered":"Recursively expand compressed files"},"content":{"rendered":"<p>If you want to know something about a file which may be buried in a .zip or .jar file somewhere.  Worse, it may be in a .war inside a .tar inside a .gz somewhere.  A brute force method for finding these files is just to expand everything recursively.<\/p>\n<p>Here&#8217;s a batch file for doing that with <a href=\"http:\/\/www.7-zip.org\/\">7-Zip<\/a> on Windows XP:<\/p>\n<p>Name it &#8220;expand.bat&#8221;<\/p>\n<pre>@echo off\nfor \/r %1 %%f in (*.7z, *.zip, *.war, *.ear, *.gzip, *.gz, *.bz2, *.tar, *.rar, *.arj, *.lzh, *.z, *.cpio) do (\n  echo %%f\n  \"C:\\Program Files\\7-Zip\\7z.exe\" x -y -o\"%%f-expanded\" \"%%f\" > nul\n  rem del \"%%f\"\n  call expand.bat \"%%f-expanded\"\n)<\/pre>\n<p>It takes one parameter with the path.<\/p>\n<p>Uncomment the <code>del<\/code> if that&#8217;s what you want it to do.  You may want to change the pattern list it&#8217;s looking for.  In my case, I didn&#8217;t want all the .jars.  This correctly handles spaces in filenames on XP.  NT and 9x work differently.<\/p>\n<p>It&#8217;s probably easier to do this with cygwin&#8217;s find rather than a Windows batch file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to know something about a file which may be buried in a .zip or .jar file somewhere. Worse, it may be in a .war inside a .tar inside a .gz somewhere. A brute force method for finding these files is just to expand everything recursively. Here&#8217;s a batch file for doing that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-windows-batch-files"],"_links":{"self":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":0,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"wp:attachment":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}