1234567891011121314151617181920212223242526272829 |
- #pragma once
-
- #include <string>
- #include <vector>
-
- namespace sys {
-
- struct FileInfo {
- long mTimeSec;
- long mTimeNsec;
- bool isDir;
-
- bool isOlderThan(FileInfo &f) {
- return mTimeSec < f.mTimeSec ||
- (mTimeSec == f.mTimeSec && mTimeNsec < f.mTimeNsec);
- }
- };
-
- FileInfo fileInfo(const std::string &path);
- bool fileExists(const std::string &path);
- void mkdirp(const std::string &path);
- void execute(const std::vector<std::string> &args, std::string *output, bool print);
- void readDir(const std::string &path, std::vector<std::string> &files);
- void chdir(const std::string &path);
- std::string cwd();
- void symlink(const std::string &from, const std::string &to);
- std::string dirname(const std::string &path);
-
- }
|