#ifndef FILE_TOOLS_H #define FILE_TOOLS_H #include #include #include "Strings.h" // collect files matching fn // if "recursive" also inspect subdirectories void fileList(const std::string& fn, std::vector& files, bool recursive = false); void dirList(const std::string& fn, std::vector& dirs, bool recursive = false); // read list of files from commandline // if "recursive" expand directories to list of files void fileList(int argc, char** argv, int optind, std::vector& files, bool recursive = false); void strings2File(const std::vector& s, const std::string& fn); void file2Strings(const std::string& fn, std::vector& s); bool dirExists(const std::string& name); bool fileExists(const std::string& name); Strings localExec(const std::string& cmd, int& rc, bool debug, const std::string& logfn = ""); Strings remoteExec(const std::string& rshCommand, const std::string& cmd, int& rc, bool debug, const std::string& logfn = ""); void removeLock(const std::string& lockfilename); void createLock(const std::string& lockfilename); int removeDir(const std::string& path); #endif