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&,
const bool followLink =
true);
113 const bool checkGzip=
true,
114 const bool followLink =
true 118 bool isDir(
const fileName&,
const bool followLink =
true);
125 const bool checkGzip=
true,
126 const bool followLink =
true 130 off_t
fileSize(
const fileName&,
const bool followLink =
true);
133 time_t
lastModified(
const fileName&,
const bool followLink =
true);
143 const bool filtergz=
true,
144 const bool followLink =
true 148 bool cp(
const fileName& src,
const fileName& dst,
const bool followLink =
true);
151 bool ln(
const fileName& src,
const fileName& dst);
158 const bool followLink =
false 163 bool mvBak(
const fileName&,
const std::string& ext =
"bak");
166 bool rm(
const fileName&);
169 bool rmDir(
const fileName&);
172 unsigned int sleep(
const unsigned int);
181 bool ping(
const string&,
const label timeOut=10);
184 int system(
const std::string& command);
188 void*
dlOpen(
const fileName& lib,
const bool check =
true);
194 void*
dlSym(
void* handle,
const std::string& symbol);
197 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 followLink=true)
Return time of last file modification.
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.
off_t fileSize(const fileName &, const bool followLink=true)
Return size of file.
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.
mode_t mode(const fileName &, const bool followLink=true)
Return the file mode.
string userName()
Return the user's login name.
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 isFile(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
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.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
word name(const complex &)
Return a string representation of a complex.
bool isAdministrator()
Is user administrator.
bool chMod(const fileName &, const mode_t)
Set the file mode.
fileName cwd()
Return current working directory path name.
fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a string list.
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.
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.
bool exists(const fileName &, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
Type
Enumerations to handle file types and modes.
int system(const std::string &command)
Execute the specified command.
double highResLastModified(const fileName &, const bool followLink=true)
Return time of last file modification.