Functions

ut_files.cpp File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "ut_files.h"
#include "ut_debugmsg.h"
#include "ut_types.h"
#include "ut_string.h"
#include "ut_misc.h"

Functions

bool progExists (const char *progName)
bool UT_createDirectoryIfNecessary (const char *szDir, bool publicdir)

Function Documentation

bool progExists ( const char *  progName  ) 

If progName is a fully qualified path (i.e. it begins with '/'), this function looks for the program with this path, returning true if it exists. Otherwise, progExists searchs the system PATH for the program progName, and returns true if it exists (i.e. is a regular file or symlink).

Ex: if(progExists("vi") { do_stuff(); }

Referenced by abi_plugin_register(), XAP_UnixAppImpl::openURL(), and XAP_QtAppImpl::openURL().

bool UT_createDirectoryIfNecessary ( const char *  szDir,
bool  publicdir 
)

Creates a directory if the specified one does not yet exist. /param A character string representing the to-be-created directory. /return True, if the directory already existed, or was successfully created. False, if the input path was already a file, not a directory, or if the directory was unable to be created. /todo Do domething with error status if the directory couldn't be created?

References UT_DEBUGMSG.

Referenced by AP_UnixApp::initialize(), AP_QtApp::initialize(), and AP_CocoaApp::initialize().