> OTOH, I don't know if this has any relevance to the problem that you are
> seeing.
not really, i have used the 'os.chmod' trick, but it's still
interesting.
thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern enlightened us with:
> Yes, the .zip file format does store file permissions appropriate to
> the platform that generates the file.
I never knew that! Thanks for correcting me ;-)
Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for s
perchef wrote:
[Sybren Stuvel:]
>>ZIP doesn't store file permissions.
Yes, the .zip file format does store file permissions appropriate to the
platform that generates the file.
> ok, but in that case how could stuffit retrieve these permissions ?
>
> Thanks for the link Robert.
When one makes
> ZIP doesn't store file permissions.
ok, but in that case how could stuffit retrieve these permissions ?
Thanks for the link Robert.
--
http://mail.python.org/mailman/listinfo/python-list
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(pa
perchef enlightened us with:
> 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.
That's right. Why should they? ZIP doesn't store file permissions.
> ZipInfo objects does
ok thanks, it works even if it's a little bit dirty.
--
http://mail.python.org/mailman/listinfo/python-list
You can use os.chmod to fix it.
Here the description:
os.chmod
Docstring:
chmod(path, mode)
Change the access permissions of a file.
Cheers,
perchef escreveu:
> hi,
>
> i have written this small code which allow me to unzip files using
> python :
>
> import zipfile
> import os
> impor
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():