fw4spl
fwTools::System Class Reference

Provide a system to get a Temporary folder which allow multi-user, multi-instance separation. More...

#include <System.hpp>

+ Collaboration diagram for fwTools::System:

Static Public Member Functions

static FWTOOLS_APIconst::boost::filesystem::path & getTempPath () noexcept
 Returns the system's temporary folder. Returns the value returned by boost::filesystem::temp_directory_path, or if boost returns no valid dir, c:\ on windows, /tmp on other systems.
 
static FWTOOLS_APIconst::boost::filesystem::path getTemporaryFolder (const std::string &subFolderPrefix="") noexcept
 Returns a unique per-process temporary folder. The top level temporary folder will be automatically destroyed if the process ends properly. More...
 
static FWTOOLS_API int tempFolderPID (const ::boost::filesystem::path &dir) noexcept
 Returns the pid of a temporary folder If the given folder contains a file matching *.pid and the first part of the file name is a integer, this method will return this number. Otherwise, zero will be returned.
 
static FWTOOLS_API void cleanZombies (const ::boost::filesystem::path &dir) noexcept
 Clean the zombie folders of old processes in given directory.
 
static FWTOOLS_API int getPID () noexcept
 Returns the pid of the current process.
 
static FWTOOLS_API bool isProcessRunning (int pid) noexcept
 Test if process is Active. More...
 
static void setTempPrefix (const std::string &prefix)
 Sets the temporary folder prefix. The prefix must be set before the first call to getTemporaryFolder, otherwise, it won't be used.
 

Static Protected Attributes

static std::string s_tempPrefix
 

Detailed Description

Provide a system to get a Temporary folder which allow multi-user, multi-instance separation.

Date
2007-2009.

Definition at line 26 of file System.hpp.

Member Function Documentation

const ::boost::filesystem::path fwTools::System::getTemporaryFolder ( const std::string &  subFolderPrefix = "")
staticnoexcept

Returns a unique per-process temporary folder. The top level temporary folder will be automatically destroyed if the process ends properly.

Parameters
subFolderPrefixif set, creates a sub folder in temporary folder prefixed with parameter value followed by a dash.
Returns
created folder

Definition at line 148 of file System.cpp.

References OSLM_INFO.

Referenced by fwGdcmIO::helper::DicomSeriesAnonymizer::anonymize(), fwMemory::BufferManager::dumpBuffer(), fwNetworkIO::http::ClientQt::getFile(), fwPacsIO::SeriesRetriever::initialize(), fwPacsIO::SeriesEnquirer::initialize(), ioPacs::SSliceIndexDicomPullerEditor::pullInstance(), ioDicom::SSliceIndexDicomEditor::readImage(), ioPacs::SSliceIndexDicomPullerEditor::readImage(), ioPacs::SSeriesPuller::readLocalSeries(), fwGdcmIO::helper::DicomAnonymizer::removeAnonymizeTag(), and ioDicomWeb::SSliceIndexDicomPullerEditor::updating().

+ Here is the caller graph for this function:

bool fwTools::System::isProcessRunning ( int  pid)
staticnoexcept

Test if process is Active.

Returns
true if the process is running

Definition at line 188 of file System.cpp.


The documentation for this class was generated from the following files: