Go to the documentation of this file.
9 #ifndef MRPT_FILESYSTEM_H
10 #define MRPT_FILESYSTEM_H
12 #include <mrpt/config.h>
52 bool BASE_IMPEXP renameFile(
const std::string &oldFileName,
const std::string &newFileName, std::string *error_msg=NULL );
121 const std::string &sourceFile,
122 const std::string &targetFile,
123 std::string *outErrStr = NULL,
124 bool copyAttribs =
true );
bool BASE_IMPEXP copyFile(const std::string &sourceFile, const std::string &targetFile, std::string *outErrStr=NULL, bool copyAttribs=true)
Copies file sourceFile to targetFile.
std::string BASE_IMPEXP extractFileDirectory(const std::string &filePath)
Extract the whole path (the directory) of a filename from a complete path plus name plus extension.
std::string BASE_IMPEXP fileNameChangeExtension(const std::string &filename, const std::string &newExtension)
Replace the filename extension by another one.
bool BASE_IMPEXP renameFile(const std::string &oldFileName, const std::string &newFileName, std::string *error_msg=NULL)
Renames a file - If the target path is different and the filesystem allows it, it will be moved to th...
bool BASE_IMPEXP deleteFile(const std::string &fileName)
Deletes a single file.
void BASE_IMPEXP deleteFiles(const std::string &s)
Delete one or more files, especified by the (optional) path and the file name (including '?...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::string BASE_IMPEXP fileNameStripInvalidChars(const std::string &filename)
Replace invalid filename chars by underscores ('_').
std::string BASE_IMPEXP extractFileExtension(const std::string &filePath, bool ignore_gz=false)
Extract the extension of a filename.
std::string BASE_IMPEXP getTempFileName()
Returns the name of a proposed temporary file name.
bool BASE_IMPEXP fileExists(const std::string &fileName)
Test if a given file (or directory) exists.
std::string BASE_IMPEXP extractFileName(const std::string &filePath)
Extract just the name (without extension) of a filename from a complete path plus name plus extension...
bool BASE_IMPEXP createDirectory(const std::string &dirName)
Creates a directory.
bool BASE_IMPEXP deleteFilesInDirectory(const std::string &s, bool deleteDirectoryAsWell=false)
Delete all the files in a given directory (nothing done if directory does not exists,...
std::string BASE_IMPEXP filePathSeparatorsToNative(const std::string &filePath)
Windows: replace all '/'->'\' , in Linux/MacOS: replace all '\'->'/'.
time_t BASE_IMPEXP getFileModificationTime(const std::string &filename)
Return the time of the file last modification, or "0" if the file doesn't exist.
bool BASE_IMPEXP directoryExists(const std::string &fileName)
Test if a given directory exists (it fails if the given path refers to an existing file).
std::string BASE_IMPEXP getcwd()
Returns the current working directory.
uint64_t BASE_IMPEXP getFileSize(const std::string &fileName)
Return the size of the given file, or size_t(-1) if some error is found accessing that file.
Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Tue Mar 3 09:15:16 UTC 2020 | | |