2#ifndef DUNE_FEM_INPUTOUPUTLOCK_HH
3#define DUNE_FEM_INPUTOUPUTLOCK_HH
22 std::string filename_;
31 static const char *
suffix() {
return "lock"; }
42 std::string lockfile(fn);
46 std::ifstream file ( lockfile.c_str () );
49 std::cerr <<
"ERROR: data set `"<<fn<<
"' not complete, lock file exists! " << std::endl;
62 inline FileIOLock :: FileIOLock (
const std::string& fn)
74 std::ofstream file ( filename_.c_str() );
77 std::cerr <<
"WARNING: Couldn't open lock file `"<<filename_<<
"' in: ";
78 std::cerr << __FILE__<<
" line: "<< __LINE__ << std::endl;
92 int test = remove (filename_.c_str()) ;
95 std::cerr <<
"WARNING: Couldn't remove lock file `"<<filename_<<
"' in: ";
96 std::cerr <<__FILE__<<
" line: " <<__LINE__ << std::endl ;
check if lock file exists and aborts if true
Definition: iolock.hh:36
FileIOCheckError(const std::string &fn)
creates lock file
Definition: iolock.hh:40
creates and removes lock file during backup process
Definition: iolock.hh:21
~FileIOLock()
removes lock file
Definition: iolock.hh:88
static const char * suffix()
suffix that is appended to lock files
Definition: iolock.hh:31
Dune namespace.
Definition: alignedallocator.hh:13