2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2005 Net Integration Technologies, Inc.
5 * A simple class to access filesystem files using WvStreams.
13 * WvAtomicFile implements a simple extension to wvfile to allow for
14 * atomic file creation. Files normally can be created and written
15 * to, however, in the event of a kernel panic the file can be left in
18 * A WvAtomicFile is atomically created on file close
21 class WvAtomicFile
: public WvFile
28 WvAtomicFile(WvStringParm filename
, int flags
= O_TRUNC
| O_CREAT
,
29 mode_t create_mode
= 0666);
32 bool open(WvStringParm filename
, int flags
= O_TRUNC
| O_CREAT
,
33 mode_t create_mode
= 0666);
36 // Like chmod(2), does *not* respect umask
37 bool chmod(mode_t mode
);
39 bool chown(uid_t owner
, gid_t group
);
42 const char *wstype() const { return "WvAtomicFile"; }
45 #endif // __WVATOMFILE_H