Go to the documentation of this file.
41 #include <sys/types.h>
70 bool setEnv(
const word&
name,
const std::string& value,
const bool overwrite);
74 string hostName(
const bool full=
false);
120 bool mandatory=
false,
165 const bool filtergz=
true
188 unsigned int sleep(
const unsigned int);
197 bool ping(
const string&,
const label timeOut=10);
200 int system(
const std::string& command);
210 void*
dlSym(
void* handle,
const std::string& symbol);
213 bool dlSymFound(
void* handle,
const std::string& symbol);
label osRandomInteger()
Return random integer (uniform distribution between 0 and 2^31)
string domainName()
Return the system's domain name, as per hostname(1) with the '-d' option.
fileName findEtcFile(const fileName &, bool mandatory=false)
Search for a file using findEtcFiles.
bool env(const word &)
Return true if environment variable of given name is defined.
PID_T ppid()
Return the parent PID of this process.
A class for handling words, derived from string.
A class for handling file names.
bool exists(const fileName &, const bool checkGzip=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
void * dlSym(void *handle, const std::string &symbol)
Lookup a symbol in a dlopened library using handle to library.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
void fdClose(const int)
Close file descriptor.
Type
Enumerations to handle file types and modes.
time_t lastModified(const fileName &)
Return time of last file modification.
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable.
bool ping(const string &, const label port, const label timeOut)
Check if machine is up by pinging given port.
void osRandomSeed(const label seed)
Seed random number generator.
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
bool dlSymFound(void *handle, const std::string &symbol)
Report if symbol in a dlopened library could be found.
unsigned int sleep(const unsigned int)
Sleep for the specified number of seconds.
bool mv(const fileName &src, const fileName &dst)
Rename src to dst.
mode_t mode(const fileName &)
Return the file mode.
bool chMod(const fileName &, const mode_t)
Set the file mode.
bool isAdministrator()
Is user administrator.
std::string toUnixPath(const std::string &path)
Convert to unix path separators.
string userName()
Return the user's login name.
PID_T pid()
Return the PID of this process.
string getEnv(const word &)
Return environment variable of given name.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool mvBak(const fileName &, const std::string &ext="bak")
Rename to a corresponding backup file.
void * dlOpen(const fileName &lib, const bool check=true)
Open a shared library. Return handle to library. Print error message.
PID_T pgid()
Return the group PID of this process.
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
bool chDir(const fileName &dir)
Change the current directory to the one given and return true,.
fileNameList findEtcFiles(const fileName &, bool mandatory=false, bool findFirst=false)
Search for files from user/group/shipped directories.
fileName home()
Return home directory path name for the current user.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
string hostName(const bool full=false)
Return the system's host name, as per hostname(1)
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
bool dlClose(void *)
Close a dlopened library using handle. Return true if successful.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
fileName cwd()
Return current working directory path name.
fileNameList dlLoaded()
Return all loaded libraries.
fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true)
Read a directory and return the entries as a string list.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
scalar osRandomDouble()
Return random double precision (uniform distribution between 0 and 1)
int system(const std::string &command)
Execute the specified command.
off_t fileSize(const fileName &)
Return size of file.
bool rmDir(const fileName &)
Remove a dirctory and its contents.
word name(const complex &)
Return a string representation of a complex.