Revision e039900c src/scheduler.cpp

View differences:

src/scheduler.cpp
23 23
#include "tunermanager.h"
24 24
#include "faketunermanager.h"
25 25
#include "utils.h"
26
#include "stringutil.h"
26 27

  
27 28
#include <sys/types.h>
28 29
#include <sys/stat.h>
......
148 149
    std::cerr << "Insufficient access to " << r.getPath() << "\n";
149 150
    return;
150 151
  }
152

  
153
  // Don't overwrite existing files
154
  std::string path = r.getPath();
155
  int n = 0;
156
  while (access(path.c_str(), F_OK) == 0)
157
    path = r.getPath() + "." + toString(++n);
151 158
  
152 159
  int openMode = O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE;
153 160

  

Also available in: Unified diff