#include <OpenMS/SYSTEM/File.h>
Static Public Member Functions | |
static bool | exists (const String &file) |
Method used to test if a file exists. | |
static bool | empty (const String &file) |
Return true if the file does not exist of the file is empty. | |
static bool | remove (const String &file) |
Removes a file (if it exists). | |
static void | absolutePath (String &file) |
Replaces the relative path in the argument with the absolute path. | |
static String | basename (const String &file) |
Returns the basename of the file (without the path). | |
static String | path (const String &file) |
Returns the path of the file (without the file name). | |
static bool | readable (const String &file) |
Return true if the file exists and is readable. | |
static bool | writable (const String &file) |
Return true if the file is writable. | |
static String | find (const String &filename, std::vector< String > directories=std::vector< String >()) |
Looks up the location of filename . | |
static bool | fileList (const String &dir, const String &file_pattern, std::vector< String > &output) |
Retrieves a list of files matching file_pattern in directory dir . | |
static String | getUniqueName () |
Returns a string, consisting of date, time, hostname, process id, and a incrementing number. This can be used for temporary files. | |
static bool | createSparseFile (const String &filename, const Offset64Int &filesize) |
Creates a sparse file filename of size filesize bytes. | |
static bool | extendSparseFile (const int &hFile, const Offset64Int &filesize) |
Extends a sparse file with handle hFile to size filesize bytes. | |
static int | getSwapFileHandle (const String &filename, const Offset64Int &filesize, const bool &create) |
get a handle to a sparse file filename with size filesize to used for swap | |
static void | closeSwapFileHandle (const int &f_handle) |
close handle to a swap file |
static bool exists | ( | const String & | file | ) | [static] |
Method used to test if a file
exists.
static bool empty | ( | const String & | file | ) | [static] |
Return true if the file does not exist of the file is empty.
static bool remove | ( | const String & | file | ) | [static] |
Removes a file (if it exists).
static void absolutePath | ( | String & | file | ) | [static] |
Replaces the relative path in the argument with the absolute path.
Returns the basename of the file (without the path).
Returns the path of the file (without the file name).
static bool readable | ( | const String & | file | ) | [static] |
Return true if the file exists and is readable.
static bool writable | ( | const String & | file | ) | [static] |
Return true if the file is writable.
static String find | ( | const String & | filename, | |
std::vector< String > | directories = std::vector< String >() | |||
) | [static] |
Looks up the location of filename
.
First the directories in directories
are cheched, then the 'data' directory of the environment variable $OPENMS_DATA_PATH is checked, at last the 'data' directory of the OpenMS built directory is checked.
If the file is not found there, an empty string is returned.
static bool fileList | ( | const String & | dir, | |
const String & | file_pattern, | |||
std::vector< String > & | output | |||
) | [static] |
Retrieves a list of files matching file_pattern
in directory dir
.
static String getUniqueName | ( | ) | [static] |
Returns a string, consisting of date, time, hostname, process id, and a incrementing number. This can be used for temporary files.
static bool createSparseFile | ( | const String & | filename, | |
const Offset64Int & | filesize | |||
) | [static] |
Creates a sparse file filename
of size filesize
bytes.
Creates a sparse* file filename
(*requires Filesystem support!) of size filesize
bytes using platform specific fileIO The function is using 64-bit fileoffsets automatically (and is therefore independent of compiler flags)
static bool extendSparseFile | ( | const int & | hFile, | |
const Offset64Int & | filesize | |||
) | [static] |
Extends a sparse file with handle hFile
to size filesize
bytes.
Extends a sparse* file with handle hFile
(*requires Filesystem support!) to size filesize
bytes using platform specific fileIO The function is using 64-bit fileoffsets automatically (and is therefore independent of compiler flags)
static int getSwapFileHandle | ( | const String & | filename, | |
const Offset64Int & | filesize, | |||
const bool & | create | |||
) | [static] |
get a handle to a sparse file filename
with size filesize
to used for swap
The file can be created (create
) if necessary
exception | on failure to acquire the handle (to make cross platform error handling easy) |
static void closeSwapFileHandle | ( | const int & | f_handle | ) | [static] |
close handle to a swap file
Generated Tue Apr 1 15:36:47 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |