41 #include <sys/types.h> 60 bool env(
const word&);
64 string getEnv(
const word&);
67 bool setEnv(
const word&
name,
const std::string& value,
const bool overwrite);
71 string hostName(
const bool full=
false);
93 bool chDir(
const fileName& dir);
97 bool mkDir(
const fileName&, mode_t=0777);
100 bool chMod(
const fileName&,
const mode_t);
103 mode_t
mode(
const fileName&);
110 bool exists(
const fileName&,
const bool checkGzip=
true);
113 bool isDir(
const fileName&);
117 bool isFile(
const fileName&,
const bool checkGzip=
true);
130 const bool filtergz=
true 134 bool cp(
const fileName& src,
const fileName& dst);
137 bool ln(
const fileName& src,
const fileName& dst);
140 bool mv(
const fileName& src,
const fileName& dst);
144 bool mvBak(
const fileName&,
const std::string& ext =
"bak");
147 bool rm(
const fileName&);
150 bool rmDir(
const fileName&);
153 unsigned int sleep(
const unsigned int);
162 bool ping(
const string&,
const label timeOut=10);
165 int system(
const std::string& command);
169 void*
dlOpen(
const fileName& lib,
const bool check =
true);
175 void*
dlSym(
void* handle,
const std::string& symbol);
178 bool dlSymFound(
void* handle,
const std::string& symbol);
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.
pid_t ppid()
Return the parent PID of this process.
scalar osRandomDouble()
Return random double precision (uniform distribution between 0 and 1)
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
bool chDir(const fileName &dir)
Change the current directory to the one given and return true,.
bool ping(const string &, const label port, const label timeOut)
Check if machine is up by pinging given port.
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
fileNameList dlLoaded()
Return all loaded libraries.
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
fileName home()
Return home directory path name for the current user.
bool mvBak(const fileName &, const std::string &ext="bak")
Rename to a corresponding backup file.
bool mv(const fileName &src, const fileName &dst)
Rename src to dst.
time_t lastModified(const fileName &)
Return time of last file modification.
string hostName(const bool full=false)
Return the system's host name, as per hostname(1)
bool dlClose(void *)
Close a dlopened library using handle. Return true if successful.
string domainName()
Return the system's domain name, as per hostname(1) with the '-d' option.
label osRandomInteger()
Return random integer (uniform distribution between 0 and 2^31)
string userName()
Return the user's login name.
off_t fileSize(const fileName &)
Return size of file.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
bool rmDir(const fileName &)
Remove a dirctory and its contents.
pid_t pid()
Return the PID of this process.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
pid_t pgid()
Return the group PID of this process.
word name(const complex &)
Return a string representation of a complex.
bool isAdministrator()
Is user administrator.
bool exists(const fileName &, const bool checkGzip=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
mode_t mode(const fileName &)
Return the file mode.
bool chMod(const fileName &, const mode_t)
Set the file mode.
fileName cwd()
Return current working directory path name.
void fdClose(const int)
Close file descriptor.
bool env(const word &)
Return true if environment variable of given name is defined.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
List< fileName > fileNameList
A List of fileNames.
unsigned int sleep(const unsigned int)
Sleep for the specified number of seconds.
void * dlOpen(const fileName &lib, const bool check=true)
Open a shared library. Return handle to library. Print error message.
fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true)
Read a directory and return the entries as a string list.
void osRandomSeed(const label seed)
Seed random number generator.
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable.
void * dlSym(void *handle, const std::string &symbol)
Lookup a symbol in a dlopened library using handle to library.
bool dlSymFound(void *handle, const std::string &symbol)
Report if symbol in a dlopened library could be found.
Type
Enumerations to handle file types and modes.
int system(const std::string &command)
Execute the specified command.