perchef wrote:
> hi,
> 
> i have written this small code which allow me to unzip files using
> python :
> 
> import zipfile
> import os
> import os.path
> 
> pathDir="/home/toto/Desktop"
> pathZip= os.path.join(pathDir,"foobar.zip")
> 
> if zipfile.is_zipfile(pathZip):
>     zf = zipfile.ZipFile(pathZip)
> 
>     for file in zf.namelist():
>       newPath = os.path.join(pathDir,file)
>       print newPath
>       if not file.endswith('/') and not os.path.exists(newPath) :
>           newFile = open(newPath, 'wb')
>           newFile.write(zf.read(file))
>           newFile.flush()
>           newFile.close()
>       else :
>           os.makedirs(newPath)
> 
>     zf.close()
> else:
>     print pathZip + " is not a zip file"
> 
> it works well but i have a small problem : i can't see how i can deal
> with file rights.
> When I unzip files with this script all the unzipped files haven't the
> good rights.
> for example :
>    with this script :
>        -rw-r--r-- foo.exe
>    with a traditional zip program (ie : stuffit ):
>        -rwxr-xr-x foo.exe
> ZipInfo objects doesn't store informations about rights ?
> (http://www.python.org/doc/current/lib/zipinfo-objects.html#zipinfo-objects)
> 
> How can i fix this ?

This is possibly related, I'm not sure:

http://article.gmane.org/gmane.comp.python.apple/8012

-- 
Robert Kern
[EMAIL PROTECTED]

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to