Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

gzip question

  • 15-05-2006 01:48PM
    #1
    Closed Accounts Posts: 169 ✭✭


    I've read the man pages, googled for tutorials but I still don't know the answer.

    I have a script which is responsible for downloading a series of zip files.
    They all have a file heirarchy
    /a/b/c/d/e/f/<target>
    so if I try to extract them within my script, I keep getting
    /targetUnzipPath/a/b/c/d/e/f/file

    Is there any way to get gzip to disregard the heirarchy and decompress everything into the folder that it's currently in?


Comments

  • Registered Users, Registered Users 2 Posts: 6,652 ✭✭✭daymobrew


    I highly doubt that it is possible using gzip alone.

    You can probably get everything into the current folder using find:
    #Find all files and mv them into the current directory
    find targetUnzipPath -type f -exec mv "{}" . ";"
    


  • Closed Accounts Posts: 169 ✭✭akari no ryu


    Between myself and our tech, we came to the conclusion you were probably right, daymobrew. We're gonna install the gzip libraries for PHP and use them. Solves all our problems, really.


Advertisement