summaryrefslogtreecommitdiff
path: root/tools.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-01-13 15:36:31 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2001-01-13 15:36:31 +0100
commit297e727a59b2e08f8c414739325f8df390b567c4 (patch)
tree0eb697cc5be0968b3fbcc7151f87e2fc5b8ac647 /tools.h
parentba2c25d1835dae0030b12e35b814c2b0ab9406fb (diff)
downloadvdr-297e727a59b2e08f8c414739325f8df390b567c4.tar.gz
vdr-297e727a59b2e08f8c414739325f8df390b567c4.tar.bz2
Implemented safe writing of config files
Diffstat (limited to 'tools.h')
-rw-r--r--tools.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools.h b/tools.h
index 83f3fa0c..539dba01 100644
--- a/tools.h
+++ b/tools.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.h 1.22 2000/12/10 11:49:42 kls Exp $
+ * $Id: tools.h 1.23 2001/01/13 15:36:00 kls Exp $
*/
#ifndef __TOOLS_H
@@ -48,6 +48,7 @@ uint FreeDiskSpaceMB(const char *Directory);
bool DirectoryOk(const char *DirName, bool LogErrors = false);
bool MakeDirs(const char *FileName, bool IsDirectory = false);
bool RemoveFileOrDir(const char *FileName, bool FollowSymlinks = false);
+char *ReadLink(const char *FileName);
class cFile {
private:
@@ -68,6 +69,19 @@ public:
static bool FileReady(int FileDes, int TimeoutMs = 1000);
};
+class cSafeFile {
+private:
+ FILE *f;
+ char *fileName;
+ char *tempName;
+public:
+ cSafeFile(const char *FileName);
+ ~cSafeFile();
+ operator FILE* () { return f; }
+ bool Open(void);
+ void Close(void);
+ };
+
class cListObject {
private:
cListObject *prev, *next;