Build tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sys.h 711B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <string>
  3. #include <vector>
  4. namespace sys {
  5. struct FileInfo {
  6. long mTimeSec;
  7. long mTimeNsec;
  8. bool isDir;
  9. bool isOlderThan(FileInfo &f) {
  10. return mTimeSec < f.mTimeSec ||
  11. (mTimeSec == f.mTimeSec && mTimeNsec < f.mTimeNsec);
  12. }
  13. };
  14. FileInfo fileInfo(const std::string &path);
  15. bool fileExists(const std::string &path);
  16. void mkdirp(const std::string &path);
  17. void execute(const std::vector<std::string> &args, std::string *output, bool print);
  18. void readDir(const std::string &path, std::vector<std::string> &files);
  19. void chdir(const std::string &path);
  20. std::string cwd();
  21. void symlink(const std::string &from, const std::string &to);
  22. std::string dirname(const std::string &path);
  23. }