1
if access is allowed, 0
if not.
See the Unix man page access(2) for more information.
Availability: Unix, Windows.
'.'
and '..'
even if they are present in the
directory.
Availability: Macintosh, Unix, Windows.
0666
(octal). The current
umask value is first masked out from the mode.
Availability: Unix.
FIFOs are pipes that can be accessed like regular files. FIFOs exist until they are deleted (for example with os.unlink()). Generally, FIFOs are used as rendezvous between ``client'' and ``server'' type processes: the server opens the FIFO for reading, and the client opens it for writing. Note that mkfifo() doesn't open the FIFO -- it just creates the rendezvous point.
0777
(octal). On some systems,
mode is ignored. Where it is used, the current umask value is
first masked out.
Availability: Macintosh, Unix, Windows.
0777
(octal). This function does not properly handle UNC
paths (only relevant on Windows systems; Universal Naming Convention
paths are those that use the `\\host\path
' syntax).
New in version 1.5.2.
pathconf_names
dictionary. For configuration variables not
included in that mapping, passing an integer for name is also
accepted.
Availability: Unix.
If name is a string and is not known, ValueError is
raised. If a specific value for name is not supported by the
host system, even if it is included in pathconf_names
, an
OSError is raised with errno.EINVAL for the
error number.
os.path.join(os.path.dirname(path), result)
.
Availability: Unix.
Note: this function can fail with the new directory structure made if you lack permissions needed to remove the leaf directory or file. New in version 1.5.2.
On some Unix systems (such as Linux), the following attributes may also be available: st_blocks (number of blocks allocated for file), st_blksize (filesystem blocksize), st_rdev (type of device if an inode device).
On Mac OS systems, the following attributes may also be available: st_rsize, st_creator, st_type.
On RISCOS systems, the following attributes are also available: st_ftype (file type), st_attrs (attributes), st_obtype (object type).
For backward compatibility, the return value of stat() is also accessible as a tuple of at least 10 integers giving the most important (and portable) members of the stat structure, in the order st_mode, st_ino, st_dev, st_nlink, st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime. More items may be added at the end by some implementations. Note that on the Mac OS, the time values are floating point values, like all time values on the Mac OS. The standard module stat defines functions and constants that are useful for extracting information from a stat structure. (On Windows, some items are filled with dummy values.) Availability: Macintosh, Unix, Windows.
Changed in version 2.2: Added access to values as attributes of the returned object.
For backward compatibility, the return value is also accessible as a tuple whose values correspond to the attributes, in the order given above. The standard module statvfs defines constants that are useful for extracting information from a statvfs structure when accessing it as a sequence; this remains useful when writing code that needs to work with versions of Python that don't support accessing the fields as attributes.
Changed in version 2.2: Added access to values as attributes of the returned object.
None
. If given and not
None
, prefix is used to provide a short prefix to the
filename. Applications are responsible for properly creating and
managing files created using paths returned by tempnam();
no automatic cleanup is provided.
On Unix, the environment variable TMPDIR overrides
dir, while on Windows the TMP is used. The specific
behavior of this function depends on the C library implementation;
some aspects are underspecified in system documentation.
Warning:
Use of tempnam() is vulnerable to symlink attacks;
consider using tmpfile() instead.
Availability: Unix, Windows.
None
, then the file's access and modified
times are set to the current time. Otherwise, times must be a
2-tuple of numbers, of the form (atime, mtime)
which is used to set the access and modified times, respectively.
Changed in version 2.0:
Added support for None
for times.
Availability: Macintosh, Unix, Windows.
See About this document... for information on suggesting changes.