March 2003
Intermediate to advanced
656 pages
39h 30m
English
access
access(path,mode)
Returns True if file
path has all of the permissions encoded in
integer mode, otherwise
False. mode can be
os.F_OK to test for file existence, or one or more
of os.R_OK, os.W_OK, and
os.X_OK (with the bitwise-OR operator
| joining them if more than one) to test
permissions to read, write, and execute the file.
access does not use the standard interpretation
for its mode argument, covered in Section 10.2.2 earlier in this chapter.
access tests only if this specific
process’s real user and group identifiers have the
requested permissions on the file. If you need to study a
file’s permission bits in more detail, see function
stat in this section.
Read now
Unlock full access