Modified DumpFile::open to accept non-existing nodes, and to actually open files in write mode -- d'oh

svn-id: r33609
This commit is contained in:
Max Horn 2008-08-04 13:25:30 +00:00
parent d061e50a7e
commit 05968b18c9

View File

@ -497,10 +497,7 @@ bool DumpFile::open(const String &filename) {
bool DumpFile::open(const FilesystemNode &node) {
assert(!_handle);
if (!node.exists()) {
warning("File::open: Trying to open a FilesystemNode which does not exist");
return false;
} else if (node.isDirectory()) {
if (node.isDirectory()) {
warning("File::open: Trying to open a FilesystemNode which is a directory");
return false;
} /*else if (!node.isReadable() && mode == kFileReadMode) {
@ -511,7 +508,7 @@ bool DumpFile::open(const FilesystemNode &node) {
return false;
}*/
_handle = fopen(node.getPath().c_str(), "rb");
_handle = fopen(node.getPath().c_str(), "wb");
if (_handle == NULL)
debug(2, "File %s not found", node.getName().c_str());