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);
106 const bool checkVariants =
true,
107 const bool followLink =
true 114 const bool checkVariants =
true,
115 const bool followLink =
true 123 const bool checkVariants =
true,
124 const bool followLink =
true 128 bool isDir(
const fileName&,
const bool followLink =
true);
135 const bool checkVariants =
true,
136 const bool followLink =
true 143 const bool checkVariants =
true,
144 const bool followLink =
true 151 const bool checkVariants =
true,
152 const bool followLink =
true 159 const bool checkVariants =
true,
160 const bool followLink =
true 168 const bool filterVariants =
true,
169 const bool followLink =
true 173 bool cp(
const fileName& src,
const fileName& dst,
const bool followLink =
true);
176 bool ln(
const fileName& src,
const fileName& dst);
183 const bool followLink =
false 188 bool mvBak(
const fileName&,
const std::string& ext =
"bak");
191 bool rm(
const fileName&);
194 bool rmDir(
const fileName&);
197 unsigned int sleep(
const unsigned int);
206 bool ping(
const string&,
const label timeOut=10);
209 int system(
const std::string& command);
213 void*
dlOpen(
const fileName& lib,
const bool check =
true);
219 void*
dlSym(
void* handle,
const std::string& symbol);
222 bool dlSymFound(
void* handle,
const std::string& symbol);
string getEnv(const word &)
Return environment variable of given name.
time_t lastModified(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return time of last file modification.
bool exists(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist (as directory or file) in the file system?
mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file mode.
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 mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
pid_t ppid()
Return the parent PID of this process.
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy, recursively if necessary, the source to the destination.
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.
fileNameList dlLoaded()
Return all loaded libraries.
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.
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.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
string domainName()
Return the system's domain name, as per hostname(1) with the '-d' option.
string userName()
Return the user's login name.
fileType
Enumeration of file types.
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
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 directory 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.
double highResLastModified(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return time of last file modification.
bool chMod(const fileName &, const mode_t)
Set the file mode.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
fileName cwd()
Return current working directory path name.
void fdClose(const int)
Close file descriptor.
off_t fileSize(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return size of file.
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.
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.
int system(const std::string &command)
Execute the specified command.