Skip to content
Snippets Groups Projects
Commit 073334fa authored by Chris Broekema's avatar Chris Broekema
Browse files

Bug #1011: Add an optional flag to filestream setting file permissions

parent 579e3ad5
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,8 @@ class FileStream : public FileDescriptorBasedStream
public:
FileStream(const char *name); // read-only; existing file
FileStream(const char *name, int mode); // rd/wr; create file
FileStream(const char *name, int flags, int mode); // rd/wr; create file, use given flags
virtual ~FileStream();
};
......
......@@ -25,6 +25,12 @@ FileStream::FileStream(const char *name, int mode)
}
FileStream::FileStream(const char *name, int flags, int mode)
{
if ((fd = open(name, flags, mode)) < 0)
throw SystemCallException("open", errno, THROW_ARGS);
}
FileStream::~FileStream()
{
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment