[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-04 Thread Éric Araujo
Éric Araujo added the comment: On second thought, maybe no fix should be backported. Changing behaviour silently might break things, changing with a new option puts the change in a grey fix/enhancement area, so maybe better to let current versions as they are, with the bug/limitation noted in

[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-04 Thread Sam Ezeh
Sam Ezeh added the comment: I don't know what the best course of action would be but if preserving permissions needs to be back-ported, could the default permission preservation flag in 3.11+ be the one to preserve safe permissions and then make it so that the previous versions (<3.11,

[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-04 Thread Éric Araujo
Change by Éric Araujo : -- versions: +Python 3.11 -Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-04 Thread Éric Araujo
Éric Araujo added the comment: The new PR uses new constants*, so could not be backported as is (see my previous message). (*side question: should the constants use an enum?) -- ___ Python tracker

[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-03 Thread Sam Ezeh
Change by Sam Ezeh : -- pull_requests: +30350 pull_request: https://github.com/python/cpython/pull/32289 ___ Python tracker ___ ___

[issue15795] Zipfile.extractall does not preserve file permissions

2022-04-03 Thread Sam Ezeh
Change by Sam Ezeh : -- nosy: +sam_ezeh ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15795] Zipfile.extractall does not preserve file permissions

2021-10-25 Thread Selim Belhaouane
Change by Selim Belhaouane : -- nosy: +selimb ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15795] Zipfile.extractall does not preserve file permissions

2021-10-23 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: I left a review on the PR requesting for some tests, if it makes sense. -- nosy: +nanjekyejoannah ___ Python tracker ___

[issue15795] Zipfile.extractall does not preserve file permissions

2021-05-31 Thread Éric Araujo
Éric Araujo added the comment: The pull request needs unit tests added to validate the changes. Note that the patch attached here was a new feature, adding constants and parameters to control the behaviour, but the PR simply checks and applies permissions bits stored in the entry. That

[issue15795] Zipfile.extractall does not preserve file permissions

2021-04-14 Thread William Woodruff
Change by William Woodruff : -- nosy: +yossarian ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15795] Zipfile.extractall does not preserve file permissions

2020-10-16 Thread Nikolay
Nikolay added the comment: Is there any chance that the pull request will be accepted? I'm a bit tired of using workaround every time I need unzip something on linux. -- nosy: +kulakov-n ___ Python tracker

[issue15795] Zipfile.extractall does not preserve file permissions

2020-01-01 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +17223 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/17790 ___ Python tracker ___

[issue15795] Zipfile.extractall does not preserve file permissions

2018-01-31 Thread ABR
Change by ABR : -- nosy: -arobert ___ Python tracker ___ ___ Python-bugs-list

[issue15795] Zipfile.extractall does not preserve file permissions

2018-01-31 Thread Étienne Dupuis
Étienne Dupuis added the comment: A workaround is provided here: https://stackoverflow.com/questions/39296101/python-zipfile-removes-execute-permissions-from-binaries -- nosy: +Étienne Dupuis ___ Python tracker

[issue29214] Standard open() does not allow to specify file permissions.

2017-07-26 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-11 Thread Christian Heimes
Christian Heimes added the comment: I like the partial opener trick. Can we have the examples in the public documentation of open(), too? -- ___ Python tracker

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: > @haypo, suppose, one thread wants file with permissions A, and other thread > wants permissions B. If they will "set" them through umask(), race condition > may occur. Ok, let's say thta you want file "x" with permission A=0o777 and file "y" with

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If you needs non-default permission for particular file, you can use one of available ways mentioned above. I think this issue can be closed. The original issues are resolved: 1. os.open() (corresponding to syscall open()) allows this. 2. There are other

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread Марк Коренберг
Марк Коренберг added the comment: @haypo, suppose, one thread wants file with permissions A, and other thread wants permissions B. If they will "set" them through umask(), race condition may occur. -- ___ Python tracker

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread Christian Heimes
Christian Heimes added the comment: Victor, you are correct. That was exactly my point. The most secure way is to tighten security and set umask to 0o077. It's basically a white list or locked down approach. With umask 0o077 all subsequent files, directories and other resources will be

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread STINNER Victor
STINNER Victor added the comment: I don't understand the problem with umask(). It's standard and affect all code even C extension calling directly or indirectly open(). It is more secure to use umask() than setting mode on a few Python open() calls no? For example, Python creates .pyc files.

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-10 Thread Brett Cannon
Brett Cannon added the comment: The point Serhiy is trying to make is that not everyone needs or cares about setting specific file permissions. Python's built-in open() function has not supported this for 26 years and so there's obviously not that much of a need if this has not consistently

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: Such construction is not so easy. Especially for beginners. Not everyone even uses context managers to work with files. They will try to use os.chmod(). More clever will use os.fchmod(fileobj.fileno()). And in rare case someone asks about race condition

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: open(..., opener=partial(os.open, mode=0o644)) Not every combination of functions deserves a new parameter of a builtin. -- ___ Python tracker

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: so, io.open() should just pass that value down to implementation. implementation should use this value instead of hard-coded 0o666. -- ___ Python tracker

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: I expect this: open(, perms=0o644) Why not? -- ___ Python tracker ___

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Brett Cannon
Brett Cannon added the comment: I agree with Serhiy that I don't think this is necessary for io.open() when os.open() supports this. But this really can't be discussed further until someone provides a clear design proposal on how to make this work with io.open(). -- nosy:

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: Permissions -- are very important thing. As I think, such high-level functions should not hide that important functionality from end-users. Also, it is not difficult to make a patch (as I think). -- ___ Python

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: io.open() is high-level function. It handles buffering, encoding, newline translating. It is even higher-level than C's fopen(). Syscall open() is low-level. Python os.open() is an interface to this low-level feature. There is a connection between low and

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: 1. Yes, I'm reporting problem about standard open(), not os.open(). 2. Yes, I know about umask. But unfortunatelly, umask affects whole process, including all threads, so it is not possible to force specific permissions without of race conditions with other

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Christian Heimes
Christian Heimes added the comment: I would be nice to have a public API to set permissions of files for io.open(), too. Note to your note: the actual permission is influenced by the process' global umask. If you are concerned about security, you should set the umask to 0o077 early.

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread STINNER Victor
STINNER Victor added the comment: You can actually specify permission: fd = os.open("document.txt", os.O_WRONLY | os.O_CREAT, 0o777) fp = open(fd, "wb") with fp: ... You can also use the dir_fd parameter for even better security ;-) Is your request for the standard open() function, rather

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Changes by Марк Коренберг : -- versions: +Python 3.7 ___ Python tracker ___ ___

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Changes by Марк Коренберг : -- type: -> behavior ___ Python tracker ___ ___

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
: open title: Standard open() does not allow to specify file permissions. versions: Python 3.5, Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue15795] Zipfile.extractall does not preserve file permissions

2016-12-23 Thread Karen Tracey
Karen Tracey added the comment: Note the zipfile being processed may have been created on a non-Unix system, and the external_attr value can't be usefully interpreted as permission bits when the value at _CD_CREATE_SYSTEM (https://hg.python.org/cpython/file/default/Lib/zipfile.py#l107) in the

[issue15795] Zipfile.extractall does not preserve file permissions

2016-03-02 Thread Mark Mikofski
Mark Mikofski added the comment: same problem in 2.7.5 on Oracle Linux 7.2 -- nosy: +bwanamarko ___ Python tracker ___

[issue15795] Zipfile.extractall does not preserve file permissions

2015-03-03 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- stage: commit review - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___

[issue15795] Zipfile.extractall does not preserve file permissions

2015-03-03 Thread Alexey Boriskin
Alexey Boriskin added the comment: I'm working on updating the patch to unify tarfile and zipfile interfaces and to restore owner/timestamp for zipfile -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795

[issue15795] Zipfile.extractall does not preserve file permissions

2015-02-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky alexander.belopol...@gmail.com: -- nosy: +belopolsky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___ ___

[issue15795] Zipfile.extractall does not preserve file permissions

2015-01-05 Thread ABR
ABR added the comment: I hope this can be finally gotten in for 3.5, even if it's not the perfect solution. I hit this issue and needed to call out to a subprocess as a work-around, but that's far less reliable. -- nosy: +arobert ___ Python

[issue15795] Zipfile.extractall does not preserve file permissions

2015-01-05 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___

asyncio: setting file permissions of a Unix socket?

2014-10-27 Thread Martin
the programs starts listening for the connections. Because of this, I can't change the file permission before a connection is made. At the same time, a connection can't happen because of the file permissions. Currently, I workaround this with os.umask(0o000). But I also want to make other files

Re: asyncio: setting file permissions of a Unix socket?

2014-10-27 Thread Michael Ströder
Martin wrote: I'm using the asyncio.Protocol interface to build a server which binds to a unix socket file. I want other system users to connect to the unix socket, so to communicate with the server. Where should I set the permissions of the file? You should start the demon with a strict

[issue15795] Zipfile.extractall does not preserve file permissions

2014-08-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The TarFile.extract() method has the set_attrs parameter which controls similar behavior but is less flexible. It would be good to unify zipfile and tarfile abilities. set_attrs also controls setting file owner and time. When we restore unsafe

[issue15795] Zipfile.extractall does not preserve file permissions

2014-06-15 Thread William Ehlhardt
Changes by William Ehlhardt williamehlha...@gmail.com: -- nosy: +Orborde ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___ ___

[issue15795] Zipfile.extractall does not preserve file permissions

2014-06-13 Thread Claudiu Popa
Changes by Claudiu Popa pcmantic...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___ ___

[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-15 Thread Glenn Jones
Glenn Jones added the comment: Patch cleaned up based on previous comments. -- Added file: http://bugs.python.org/file34873/issue15795_cleaned.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795

[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-15 Thread Claudiu.Popa
Claudiu.Popa added the comment: Hello. I added a couple of comments to your latest patch. -- nosy: +Claudiu.Popa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___

[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-15 Thread Glenn Jones
Glenn Jones added the comment: Patch with docs and tests fixed -- Added file: http://bugs.python.org/file34893/issue15795_test_and_doc_fixes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795

[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-14 Thread Glenn Jones
Glenn Jones added the comment: Here is an updated patch that applies cleanly to head. Tests pass against head of repo. -- nosy: +Glenn.Jones Added file: http://bugs.python.org/file34852/issue15795_updated.patch ___ Python tracker

[issue15795] Zipfile.extractall does not preserve file permissions

2014-04-14 Thread R. David Murray
R. David Murray added the comment: Thanks. The patch contains a number of lines that are not wrapped to 80, which is one of our requirements. It would be great to get that fixed. (In the documentation, you can use \ to wrap the prototype line.) There is non-ascii in one place in the

[issue5300] distutils ignores file permissions

2013-10-23 Thread Garrett Cooper
Garrett Cooper added the comment: The whole permissions setting operation seems a bit convoluted. I was hoping there was something formalized with install_data.py where I could specify a default or fine-grained user/group/mode for files, but it doesn't appear to be possible. I'll investigate

[issue15795] Zipfile.extractall does not preserve file permissions

2013-06-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: On first glance the patch looks good. I haven't tested it with the current trunk though. -- nosy: +ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795

[issue15795] Zipfile.extractall does not preserve file permissions

2013-06-18 Thread anatoly techtonik
Changes by anatoly techtonik techto...@gmail.com: -- nosy: +techtonik ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___ ___ Python-bugs-list

[issue15795] Zipfile.extractall does not preserve file permissions

2013-06-18 Thread anatoly techtonik
anatoly techtonik added the comment: There should be an easy way to restore file attributes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___

[issue15795] Zipfile.extractall does not preserve file permissions

2013-03-01 Thread Cédric de Saint Martin
Changes by Cédric de Saint Martin ced...@desaintmartin.fr: -- nosy: +desaintmartin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___ ___

[issue15795] Zipfile.extractall does not preserve file permissions

2012-10-31 Thread Aaron Train
Aaron Train added the comment: Thanks for the patch. Is this going to be resolved soon? -- nosy: +Aaron.Train ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___

[issue15795] Zipfile.extractall does not preserve file permissions

2012-10-31 Thread R. David Murray
R. David Murray added the comment: OK, so this is an enhancement to specifically allow preservation of unsafe permissions? Adding the nosy list from issue 3394. -- nosy: +cbrannon, pitrou, swarren type: behavior - enhancement versions: -Python 2.7

[issue15795] Zipfile.extractall does not preserve file permissions

2012-09-01 Thread Alexey Boriskin
Changes by Alexey Boriskin sun.v...@gmail.com: -- hgrepos: +147 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___ ___ Python-bugs-list

[issue15795] Zipfile.extractall does not preserve file permissions

2012-09-01 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- hgrepos: -147 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15795 ___ ___ Python-bugs-list

[issue15795] Zipfile.extractall does not preserve file permissions

2012-09-01 Thread Alexey Boriskin
Alexey Boriskin added the comment: I'm attaching a patch, which solves the issue. Patch intoduces new argument preserve_permissions for extract and extractall methods. That argument may accept one of the three values: do not preserve permissions, preserve a safe subset of them or preserve all

[issue15795] Zipfile.extractall does not preserve file permissions

2012-08-27 Thread Alexey Boriskin
New submission from Alexey Boriskin: Zipfile._extract_member does not preserve file permissions while extracting it. As may be seen at link[1], raw open() is used and no os.chmod() applied after that, therefore any permission data stored in zipfile is dropped and file is created with default

[issue15795] Zipfile.extractall does not preserve file permissions

2012-08-27 Thread R. David Murray
R. David Murray added the comment: Does this have any relationship to issue 3394? From the discussion on that issue it sounds like zipfile is doing things with external_attributes if it is set. But I don't know much about zipfile internals. -- nosy: +r.david.murray

[issue5300] distutils ignores file permissions

2012-02-03 Thread Patrick Andrew
Changes by Patrick Andrew pand...@isilon.com: -- components: +Distutils2 -Distutils nosy: +alexis title: build_module failure - distutils ignores file permissions versions: +3rd party -Python 2.7 ___ Python tracker rep...@bugs.python.org http

[issue5300] Distutils ignores file permissions

2012-01-16 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: FTR it looks like http://mail.python.org/pipermail/python-list/2009-January/1188084.html was the original report for this. -- ___ Python tracker rep...@bugs.python.org

[issue5300] Distutils ignores file permissions

2010-09-29 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- keywords: +easy stage: - unit test needed versions: +3rd party -Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5300

[issue5300] Distutils ignores file permissions

2010-08-10 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- components: +Distutils2 -Distutils versions: +Python 2.5, Python 2.6, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5300 ___

[issue5300] Distutils ignores file permissions

2010-06-03 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +merwok ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5300 ___ ___ Python-bugs-list mailing

Reading and setting file permissions programmatically

2009-06-17 Thread Cameron Pulsford
Sorry to flood the list but my google fu isn't up to par today I guess. Basically, is it possible to read the permissions on one file and then set the permissions of another file to the ones we just read? os.dup2 seemed like it would work but I might not be using it correctly. I know there is

Re: Reading and setting file permissions programmatically

2009-06-17 Thread MRAB
Cameron Pulsford wrote: Sorry to flood the list but my google fu isn't up to par today I guess. Basically, is it possible to read the permissions on one file and then set the permissions of another file to the ones we just read? os.dup2 seemed like it would work but I might not be using it

Re: Reading and setting file permissions programmatically

2009-06-17 Thread Kushal Kumaran
On Thu, Jun 18, 2009 at 2:05 AM, Cameron Pulsfordcameron.pulsf...@gmail.com wrote: Sorry to flood the list but my google fu isn't up to par today I guess. Basically, is it possible to read the permissions on one file and then set the permissions of another file to the ones we just read? os.dup2

Re: mailbox.mbox.add() also seems to set file permissions

2009-04-27 Thread tinnews
Aahz a...@pythoncraft.com wrote: In article gksdnzap17601g7unz2dnuvz_jti4...@posted.visi, Grant Edwards inva...@invalid wrote: On 2009-04-25, tinn...@isbd.co.uk tinn...@isbd.co.uk wrote: Where should one report bugs/errors in python library classes? http://docs.python.org/bugs.html

Re: mailbox.mbox.add() also seems to set file permissions

2009-04-26 Thread Aahz
In article gksdnzap17601g7unz2dnuvz_jti4...@posted.visi, Grant Edwards inva...@invalid wrote: On 2009-04-25, tinn...@isbd.co.uk tinn...@isbd.co.uk wrote: Where should one report bugs/errors in python library classes? http://docs.python.org/bugs.html That's for doc bugs; regular bugs go to

mailbox.mbox.add() also seems to set file permissions

2009-04-25 Thread tinnews
mailbox.mbox.add() has *another* 'quirk'. When it adds a message to an mbox file it seems to set the permissions to 0755 which is quite wrong for mbox files. I get the feeling that the mbox versions of the functions are just bodged maildir ones. If one was creating a maildir it *might* make

Re: mailbox.mbox.add() also seems to set file permissions

2009-04-25 Thread Grant Edwards
On 2009-04-25, tinn...@isbd.co.uk tinn...@isbd.co.uk wrote: Where should one report bugs/errors in python library classes? http://docs.python.org/bugs.html -- Grant Edwards grante Yow! Gee, I feel kind of at LIGHT

[issue5300] Distutils ignores file permissions

2009-02-18 Thread George Sakkis
), they are not supposed to be called directly by clients. But How do you handle the overwrite of a read-only file in your code then ? I didn't, all my files were writable (by me), but if I had to, I'd look at tweaking the directory write permissions; as I mentioned, I don't think file permissions affect

[issue5300] Distutils ignores file permissions

2009-02-17 Thread George Sakkis
New submission from George Sakkis george.sak...@gmail.com: Distutils ignores file permissions when copying modules and package_data files to the build directory, and consequently to the installation directory too. According to an XXX comment at distutils/command/build_py.py, this is deliberate

[issue5300] Distutils ignores file permissions

2009-02-17 Thread Tarek Ziadé
Tarek Ziadé ziade.ta...@gmail.com added the comment: I believe that the default behavior should be changed to preserve all permissions, with the possible exception of setting u+w. Even that might be unnecessary; AFAIK to delete a file you need write permissions only to its parent

Preserving file permissions with distutils

2009-01-14 Thread George Sakkis
I'm trying to use distutils to install some package data and additional files, some of which may be executable. It turns out that distutils does not preserve the permissions. Digging in the code, there is the following comment on distutils/command/build_py: # XXX copy_file by default

Re: Checking File permissions

2006-07-21 Thread Tal Einat
Anoop wrote: Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop os.access(path, mode) does just this, check it out. Cross-platform-ness isn't a problem, the docs say it is available for Windows,

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list

Checking File permissions

2006-07-20 Thread Anoop
Hi All Please tell me how to check the existence of a file and the read permission to the file using python script Thanks for ur inputs Anoop -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking File permissions

2006-07-20 Thread Avell Diroll
Anoop wrote: Please tell me how to check the existence of a file and the read permission to the file using python script You can check the os module (os.stat comes to mind). For an exemple you can have a look at : http://www.pixelbeat.org/talks/python/ls.py Regards, Avell --

Re: Checking File permissions

2006-07-20 Thread Larry Bates
Note: You really don't have to post the same question 3 times (2 in response to yourself). import os if os.path.exists(pathname): do something To see if a file is writeable: import stat def iswriteable(path): mode=os.stat(path)[stat.ST_mode] return bool(stat.S_IMODE(mode)

Re: Checking File permissions

2006-07-20 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Anoop wrote: Please tell me how to check the existence of a file and the read permission to the file using python script Without knowing what your precise needs are, the best way is to open the file and try to read from it. If that succeeds, then you've got read

Re: setting file permissions on a web server

2006-04-30 Thread Rene Pijlman
John Salerno: I always read about how you need to set certain file permissions (for cgi files, for example), but it's never been clear to me *how* you do this. I know you can run the line chmod 755 scriptname.py but *where* do you run this? This is a Unix/Linux command. You run it in a shell

Re: setting file permissions on a web server

2006-04-30 Thread Daniel Nogradi
I always read about how you need to set certain file permissions (for cgi files, for example), but it's never been clear to me *how* you do this. I know you can run the line chmod 755 scriptname.py but *where* do you run this? Is this done on your personal system, or on the server? What

Re: setting file permissions on a web server

2006-04-30 Thread John Salerno
you can do it in any case. Depending on your ftp, scp, http or whatever method you use to transfer files the file permissions may or may not change during the transfer. If permissions are kept intact you can chmod on your local machine and then transfer, if they are not then you transfer first

Re: setting file permissions on a web server

2006-04-30 Thread Diez B. Roggisch
I suppose I could write a script that would set the permissions of all the files in a particular folder on my computer to 755, but is there a Windows equivalent command for chmod to do this? Or am I stuck having to do it on the server side? The chmod has to be executed on the machine the

Re: setting file permissions on a web server

2006-04-30 Thread Daniel Nogradi
it in any case. Depending on your ftp, scp, http or whatever method you use to transfer files the file permissions may or may not change during the transfer. If permissions are kept intact you can chmod on your local machine and then transfer, if they are not then you transfer first and chmod

Re: setting file permissions on a web server

2006-04-30 Thread Edward Elliott
John Salerno wrote: Thanks, but I'm still a little confused. Since I'm running Windows You misplaced your period, it goes at the end of that line. ;) assume that I can't run the chmod line on my own computer. Sure you can, install cygwin. chmod only affects files on your computer, and won't

Re: setting file permissions on a web server

2006-04-30 Thread Edward Elliott
Daniel Nogradi wrote: I have next to zero experience with windows but as far as I know windows doesn't have file permissions at all (anyone, please correct me if I'm wrong :)) so in windows land it doesn't make any sense to change file permissions. Actually Windows has a quite good

Re: setting file permissions on a web server

2006-04-30 Thread Kirk McDonald
Daniel Nogradi wrote: I have next to zero experience with windows but as far as I know windows doesn't have file permissions at all (anyone, please correct me if I'm wrong :)) so in windows land it doesn't make any sense to change file permissions. Even if it has some sort of a notion of file

Re: setting file permissions on a web server

2006-04-30 Thread John Salerno
Daniel Nogradi wrote: This depends on your arrangements with your web server provider. Perhaps you are allowed to ssh into that machine, perhaps not, you need to ask your provider. In case you can use ssh, then you can log in with putty (an ssh client for windows, grab it from here:

Re: setting file permissions on a web server

2006-04-30 Thread Martin P. Hellwig
John Salerno wrote: cut Most FTP servers do allow to use chmod in a ftp session, although you're client must support it. See for example a cli ftp client (and server) on FreeBSD. [EMAIL PROTECTED]:~$ ftp ftp.xs4all.nl Connected to ftp2.xs4all.nl. 220 XS4ALL ftpd DCLXVI Name

setting file permissions on a web server

2006-04-29 Thread John Salerno
I always read about how you need to set certain file permissions (for cgi files, for example), but it's never been clear to me *how* you do this. I know you can run the line chmod 755 scriptname.py but *where* do you run this? Is this done on your personal system, or on the server? What

Re: File Permissions

2006-03-18 Thread Christos Georgiou
On Fri, 10 Mar 2006 16:43:15 +0200, rumours say that Juho Schultz [EMAIL PROTECTED] might have written: VJ wrote: Hi All Basically i want to write into a file .If the permissions are not there then print a error message. How do i achive this ??? Thanks, VJ One way would be a

  1   2   >