HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_DirUtil.h File Reference
#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>
+ Include dependency graph for UT_DirUtil.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

UT_API int UTunixFullPathSpecified (const char *name)
 
UT_API int UTfullPathSpecified (const char *name)
 
UT_API bool UTisAbsolutePath (const char *filename)
 
UT_API bool UTisRootPath (const char *filename)
 
UT_API int UTgetRootPrefixLength (const char *filename)
 
UT_API void UTmakeAbsoluteFilePath (UT_String &path, const char *basepath=nullptr)
 
UT_API void UTmakeAbsoluteFilePath (UT_StringHolder &path, const char *basepath=nullptr)
 
UT_API const UT_StringArrayUTgetAbsolutePathPrefixes ()
 
UT_API void UTaddAbsolutePathPrefix (const char *prefix)
 
UT_API bool UTisHiddenFile (const char *filename)
 
UT_API bool UTisValidRegularFile (const char *path)
 
UT_API bool UTisValidDirectory (const char *path)
 Returns true if the given path is a readable directory. More...
 
UT_API bool UTisDirectory (const char *path)
 Returns true if path is a directory, without permission checks. More...
 
UT_API bool UTisRegularFile (const char *path)
 Returns true if path is a regular file, without permission checks. More...
 
UT_API bool UTfileExists (const char *path)
 
UT_API char * getUnixCwd (char *buffer, int maxlen)
 Get the current working directory. More...
 
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. More...
 

Function Documentation

UT_API char* getUnixCwd ( char *  buffer,
int  maxlen 
)

Get the current working directory.

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.

UT_API void UTaddAbsolutePathPrefix ( const char *  prefix)
Examples:
FS/FS_HomeHelper.C.
UT_API bool UTfileExists ( const char *  path)

Returns true if file path exists, without permission checks. This is optimized for known platforms.

UT_API int UTfullPathSpecified ( const char *  name)
UT_API const UT_StringArray& UTgetAbsolutePathPrefixes ( )
UT_API int UTgetRootPrefixLength ( const char *  filename)

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

UT_API bool UTisAbsolutePath ( const char *  filename)
UT_API bool UTisDirectory ( const char *  path)

Returns true if path is a directory, without permission checks.

UT_API bool UTisHiddenFile ( const char *  filename)
UT_API bool UTisRegularFile ( const char *  path)

Returns true if path is a regular file, without permission checks.

UT_API bool UTisRootPath ( const char *  filename)
UT_API bool UTisValidDirectory ( const char *  path)

Returns true if the given path is a readable directory.

UT_API bool UTisValidRegularFile ( const char *  path)

Returns true if the given path is a readable, regular file, ie. not a directory.

UT_API void UTmakeAbsoluteFilePath ( UT_String path,
const char *  basepath = nullptr 
)
UT_API void UTmakeAbsoluteFilePath ( UT_StringHolder path,
const char *  basepath = nullptr 
)
UT_API int UTunixFullPathSpecified ( const char *  name)