+++ /dev/null
-#include <msp/fs/dir.h>
-#include <msp/fs/stat.h>
-#include <msp/fs/utils.h>
-#include "task.h"
-
-using namespace std;
-using namespace Msp;
-
-void Task::add_file(const FS::Path &f)
-{
- files.push_back(f);
-}
-
-void Task::set_unlink(bool u)
-{
- unlink = u;
-}
-
-void Task::prepare()
-{
- for(const FS::Path &f: files)
- {
- if(FS::exists(f))
- {
- // If the file exists, the directory it's in must exist too
- FS::unlink(f);
- }
- else
- {
- FS::Path dir = FS::dirname(f);
- if(!FS::exists(dir))
- FS::mkpath(dir, 0755);
- }
- }
-}