TestUtil.cc 256 B

123456789101112131415
  1. #include "TestUtil.h"
  2. #include "a2io.h"
  3. #include <sys/types.h>
  4. #include <sys/stat.h>
  5. #include <fcntl.h>
  6. namespace aria2 {
  7. void createFile(const std::string& path, size_t length)
  8. {
  9. int fd = creat(path.c_str(), OPEN_MODE);
  10. ftruncate(fd, length);
  11. }
  12. };