Revision e039900c

View differences:

ChangeLog
1 1
2004-01-03  John Knottenbelt  <jak@users.sourceforge.net>
2 2
        Modified schedule format so that extra information
3
	can be associated with each recording (Warning:
4
	change is not backwards compatible).
5

  
3
	 can be associated with each recording (Warning:
4
	 change is not backwards compatible).
5
	Scheduler now appends .N (where N is a number from 1)
6
	 if the output file already exists.
7
	
6 8
2004-01-02  John Knottenbelt  <jak@users.sourceforge.net>
7 9
	Added -n,--noconflicts option to dvbsched which
8 10
	won't schedule the job if it produces any conflicts.
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