HDK
|
#include "UT_API.h"
#include "UT_FileStat.h"
#include <SYS/SYS_Deprecated.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <stdlib.h>
Go to the source code of this file.
UT_API int statLastRead | ( | DIR * | dirp, |
const char * | path, | ||
UT_FileStat & | file_stat | ||
) |
Do the equivalent of a stat on the last file from readdir or opendir.
Returns true if file path exists, without permission checks. This is optimized for known platforms.
UT_API const UT_StringArray& UTgetAbsolutePathPrefixes | ( | ) |
Functions to manage the set of prefixes which Houdini treats as being valid ways to start an absolute path.
UTgetRootPrefixLength() returns the length of the root part of the file path.
The remainder of the file path after the root part length will have one of the following forms: '/path/to/file' => for absolute paths 'relative/path/to/file' => for relative paths '' => for root paths
Some examples of input file paths and output root lengths: '/path/to/file' => 0 'relative/path/to/file' => 0 'C:/path/to/file' => 2 (Windows only) 'C:relative/path/to/file' => 2 (Windows only) '//path/to/file' => 1 (Windows only) '//path/to/file' => 0 (Unix only) 'file:///path/to/file' => 5 'file:/path/to/file' => 5 'file:relative/path/to/file'=> 5
Returns true if path is a directory, without permission checks.
Checks if the file name starts with '.'. basepath (parent directory) is ignored in non Windows envirenment, whereas in Windows full path is needed to see if the file has the hidden attribute.
Returns true if path is a regular file, without permission checks.
Returns true if the given path is a readable directory.
Returns true if the given path is a readable, regular file, ie. not a directory.
Functions to convert absolute paths into relative paths and vice versa, given a path and a "base" path which is used as the root location for relative paths. When basepath is not given, getUnixCwd() will be used.
UT_API void UTmakeAbsoluteFilePath | ( | UT_StringHolder & | path, |
const char * | basepath = nullptr |
||
) |
UT_API void UTmakeRelativeFilePath | ( | UT_StringHolder & | path, |
const char * | basepath = nullptr |
||
) |
Normalizes a file path. This means ensuring all slashes are forward slashes, removing redundant slashes, and collapsing '..' and '.' components as much as possible (whether they occur at the start or in the middle of the path).
UT_API void UTnormalizeFilePath | ( | UT_StringHolder & | path | ) |
Resolves symlinks, symbolic links on a path. Calls ::realpath() or fs::canonical() depdending of the platform.
UT_API void UTrealPath | ( | UT_StringHolder & | path | ) |