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);
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
fileName cwd()
Return current working directory path name.
int system(const std::string &command)
Execute the specified command.
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable.
off_t fileSize(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return size of file.
bool mvBak(const fileName &, const std::string &ext="bak")
Rename to a corresponding backup file.
mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file mode.
List< fileName > fileNameList
A List of fileNames.
bool env(const word &)
Return true if environment variable of given name is defined.
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 rm(const fileName &)
Remove a file, returning true if successful otherwise false.
bool dlSymFound(void *handle, const std::string &symbol)
Report if symbol in a dlopened library could be found.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
bool isAdministrator()
Is user administrator.
word name(const bool)
Return a word representation of a bool.
void * dlOpen(const fileName &lib, const bool check=true)
Open a shared library. Return handle to library. Print error message.
double highResLastModified(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return time of last file modification.
bool dlClose(void *)
Close a dlopened library using handle. Return true if successful.
bool exists(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist (as directory or file) in the file system?
void fdClose(const int)
Close file descriptor.
string userName()
Return the user's login name.
pid_t pgid()
Return the group PID of this process.
string hostName(const bool full=false)
Return the system's host name, as per hostname(1)
bool chMod(const fileName &, const mode_t)
Set the file mode.
bool rmDir(const fileName &)
Remove a directory and its contents.
pid_t ppid()
Return the parent PID of this process.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
bool ping(const string &, const label port, const label timeOut)
Check if machine is up by pinging given port.
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.
pid_t pid()
Return the PID of this process.
fileType
Enumeration of file types.
void * dlSym(void *handle, const std::string &symbol)
Lookup a symbol in a dlopened library using handle to library.
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy, recursively if necessary, the source to the destination.
fileNameList dlLoaded()
Return all loaded libraries.
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
fileName home()
Return home directory path name for the current user.
unsigned int sleep(const unsigned int)
Sleep for the specified number of seconds.
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.
string domainName()
Return the system's domain name, as per hostname(1) with the '-d' option.
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
bool chDir(const fileName &dir)
Change the current directory to the one given and return true,.