Methods ¶
__str__()
→ str
Convert the path object to a string.
exists()
→ bool
Whether the path points to an existing file or directory.
is_file()
→ bool
Return True if the path points to a regular file (or a symbolic link pointing to a regular file), False if it points to a directory. False is also returned if the path doesn’t exist or if the user doesn’t have read access.
is_dir()
→ bool
Return True if the path points to a directory (or a symbolic link pointing to a directory), False if it points a file. False is also returned if the path doesn’t exist or if the user doesn’t have access.
match(pattern)
→ bool
Match the path string against the provided glob-style pattern (str
).
Return True if matching is successful, False otherwise. Multiple patterns can be given if separated by commas: ,
.
glob(pattern)
→ list
of hou.fs.Path
Glob the given relative pattern in the directory represented by this path, yielding the path objects of all matching files (of any kind).
iterdir()
→ list
of hou.fs.Path
When the path points to a directory, yield path objects of the directory contents.
mkdir(mode = 0777, ignore_umask = False)
Create a new directory and all the parent directories needed. By default, the users umask will be used in conjunction with the mode. ignore_umask will force the mode to be the given value.
open(mode)
→ hou.fs.FileReader or hou.fs.FileWriter
Open the file pointed to by the path for reading or writing, similar to python’s built-in open()
.
Mode can be one of "r"
, "w"
, "rb"
, or "wb"
.
See also |