OS X: Unzip Protected Zip

March 17, 2008 – 10:20 pm

This weekend I went to the local Botball workshop at UMUC where they gave our team the lego kits and an instructional CD. I head home and pop in the CD only to find that I can’t unzip the included Zip file. I suspect that the file is protected (with the password they gave us) but Archive Utility (Mac’s default uncompresser) simply says that permission is denied. First I try giving myself full read write permissions like so;

Osiris:~ amir$sudo chmod a+w+x BBallGame.zip

but still I get the same error. I then found out that I can unzip the file in the Terminal with this command;
Osiris:~ amir$ /usr/bin/unzip BBallGame.zip
This did infact ask me for a password and once entered, successfully unzipped my file.

  1. One Response to “OS X: Unzip Protected Zip”

  2. Hi Amir,
    Cool website you’ve got there!
    Anw,
    I came across your blog and website, seeing that you’ve got some experience in programming.
    So I thought you’d be able to help me with a script using Ruby which I have been working on these few wks..

    Basically, I need to work on a script to archive files, using Ruby to read a config file(where Robocopy commands are listed inside). But the thing is I need to write whatever is happening into a log file for any reference if neccessary.. here’s an example of my code..

    if File.exists?( “test.cfg” ) then

    f = File.new( "test.cfg", "r" )
    
    run_seq=0
    
    f.each do |l|
    
    l.chomp!
    
    if ( l  "" or l =~ /^[t]*#.*$/ )
    # it's a blank line or starts with '#'
    next
    end # if
    

    @commands[l] = run_seq

    run_seq+=1

    end # each

    # Lets close the file

    f.close()

    else
    raise "config file does not exist."
    return 1
    end # if
    

    Take back-up copy for potential use later on

    @bck_up_commands = @commands.dup
    

    Loop through commands untill all are completed.

    commands_to_run = true
    
    while ( commands_to_run )
    
        # Assume all commands run
        commands_to_run = false
    
        if ( $run_time  b[1] }.each do | run_command, status |
    

    Only run commands that have not been successful.

        if status != $ran then
    
        ret = 0
    
        #puts "#{run_command}n"
        system run_command
        ret = $?
    

    if successful then mark as ‘ran’

        if ( ret  0 )
    puts “#{run_command}  COMPLETEDn”
                        @commands[run_command]= $ran
    else
                        puts “#{run_command}  HAS NOT COMPLETEDn”
                    end # if
    
    end # if
    

    end # do

    Initialise toruncommand hash

    @toruncommands = {}

    Search hash for commnads to run

    @commands.sort { |a,b| a[1] b[1] }.each do | run_command, status |

    if status != $ran then
                    commands_to_run = true
    
                    @to_run_commands[run_command] = status
    
    end # if
    

    end # do

    if ( @to_run_commands.size >= 1 )
    

    raise “All or some commands have not completed in command file”

    return 2
    end

    end # if
    
    $run_time+= $defaultPollIntervalSec
    sleep $defaultPollIntervalSec
    
    end # while
    

    I’m so sorry that they alignment is abit messed up, but I really need some desperate help here.. So any help is much appreciated. Do drop me an email for your reply if possible eh? Thanks. :)

    By Clement on Apr 1, 2008

Post a Comment