Commit 0498d3f1 authored by Tristan Cavelier's avatar Tristan Cavelier

Add cros-unzip.py to allow to unzip in ChromeOS in developer mode as Guest

`python -m zipfile -e ARCHIVE TARGET` don't do the work every time :

Traceback (most recent call last):
  File "/usr/local/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib64/python2.7/zipfile.py", line 1439, in <module>
    main()
  File "/usr/local/lib64/python2.7/zipfile.py", line 1414, in main
    with open(tgt, wb) as fp:
IOError: [Errno 21] Is a directory: 'TARGET/ARCHIVE/'
parent 2e47249f
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Extracts files from a .zip container to the current working directory.
http://stackoverflow.com/questions/7806563/how-to-unzip-a-file-with-python-2-4
"""
import sys
import zipfile
zfile = zipfile.ZipFile(sys.argv[1]) # Usage: unzip ZIPFILE
zfile.extractall(".")
zfile.close()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment