Object |
Describe |
Os.path.split (filename) |
Split the file path and filename (the last directory will be separated as the file name) |
Os.path.splitext (filename) |
Splitting a file path and file name extension into a single tuple |
Os.path.dirname (filename) |
Returns the directory portion of the file path |
Os.path.basename (filename) |
Returns the filename portion of the file path |
Os.path.join (Dirname,basename) |
Make the file path and filename into full file path |
Os.path.abspath (name) |
Get absolute path |
Os.path.splitunc (PATH) |
To split a path into a mount point and file name |
Os.path.normpath (PATH) |
Canonical Path string form |
Os.path.exists () |
Determine if a file or directory exists |
Os.path.isabs () |
Returns true if path is an absolute path |
Os.path.realpath (PATH) |
Returns the real path of a path |
Os.path.relpath (path[, start]) |
Calculate relative path starting from start |
Os.path.normcase (PATH) |
Convert the case and slash of path |
Os.path.isdir (name) |
Determine if name is a directory, name is not a directory and return false |
Os.path.isfile (name) |
Determine if name is not a file, there is no return false |
Os.path.islink () |
Determines whether the file is connected to a file, returns a Boolean |
Os.path.ismount () |
Specifies whether the path exists and is a mount point, returning a Boolean |
Os.path.samefile () |
is the same path as the file that returns a Boolean |
Os.path.getatime () |
Returns the most recent access time floating-point type |
Os.path.getmtime () |
Returns the last modified time floating-point type |
Os.path.getctime () |
Returns the file creation time floating point type |
Os.path.getsize () |
Return File size byte units |
Os.path.commonprefix (list) |
Returns the longest path in a list (multiple paths) that all paths share |
Os.path.lexists |
Path exists returns true, path corruption also returns true |
Os.path.expanduser (PATH) |
Convert the "~" and "~user" contained in path to the user directory |
Os.path.expandvars (PATH) |
Replace the "$name" and "${name}" contained in path with the value of the environment variable |
Os.path.sameopenfile (FP1, FP2) |
Determine if FP1 and FP2 point to the same file |
Os.path.samestat (STAT1, STAT2) |
Determine if stat tuple STAT1 and Stat2 point to the same file |
Os.path.splitdrive (PATH) |
Typically used under Windows, returns a tuple of drive names and paths |
Os.path.walk (path, visit, ARG) |
Traverse path, execute a function for each path see manual for details |
Os.path.supports_unicode_filenames |
Set whether Unicode path names are supported |