[Python-bugs-list] [ python-Bugs-755617 ] os module: Need a better description of "mode"
SourceForge.net
noreply@sourceforge.net
Mon, 16 Jun 2003 19:51:48 -0700
Bugs item #755617, was opened at 2003-06-16 19:13
Message generated for change (Comment added) made by logistix
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=755617&group_id=5470
Category: Documentation
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthew Shomphe (mshomphe)
Assigned to: Nobody/Anonymous (nobody)
Summary: os module: Need a better description of "mode"
Initial Comment:
The page <http://www.python.
org/doc/current/lib/os-file-dir.html> says the following
about the function os.chmod:
chmod(path, mode)
Change the mode of path to the numeric mode.
Availability: Unix, Windows.
The "mode" values are unclear. It turns out that the
UNIX file permission set (e.g., 0666 for read/writeable)
works with the Windows set (where 0666 translates to
33206).
Is it possible to describe the file permissions in more
detail in the documentation at this point?
Attached is an email thread discussing this
documentation issue.
----------------------------------------------------------------------
Comment By: logistix (logistix)
Date: 2003-06-16 21:51
Message:
Logged In: YES
user_id=699438
Realistically, you should NEVER intentionally use chmod to set
file permissions on Windows. The FAT filesystem has no
permissions, and NTFS has ACLs which are much too complex
to map to a chmod style call. MS only has chmod support so
they can claim some level of posix compliance.
I'm not saying you should drop the ability to call os.chmod on
windows, but perhaps the docs should say that its not the
recommended way of doing things. Unfortunately, there's not
a recommended way of setting security that'll work on all
Windows platforms either (although I'd start with os.popen
("cacls ...") Even win32security requires some serious
programming just to get started with manipulating ACLs.
Typical security looks something like this:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\grant>xcacls "\Program files"
C:\Program Files BUILTIN\Users:R
BUILTIN\Users:(OI)(CI)(IO)(special access:)
GENERIC_READ
GENERIC_EXECUTE
BUILTIN\Power Users:C
BUILTIN\Power Users:(OI)(CI)(IO)C
BUILTIN\Administrators:F
BUILTIN\Administrators:(OI)(CI)(IO)F
NT AUTHORITY\SYSTEM:F
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F
BUILTIN\Administrators:F
CREATOR OWNER:(OI)(CI)(IO)F
C:\Documents and Settings\grant>
----------------------------------------------------------------------
Comment By: Matthew Shomphe (mshomphe)
Date: 2003-06-16 21:05
Message:
Logged In: YES
user_id=716326
Here's my first pass at some additional documentation. My
HTML skills are not up to par, but I've tried :) I've attached
the document separately.
m@
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2003-06-16 20:06
Message:
Logged In: YES
user_id=33168
Could you try to produce a patch to improve the
documentation? Or perhaps suggest better wording?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=755617&group_id=5470