// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: fileutl.cc,v 1.27 1999/04/20 05:02:09 jgg Exp $
+// $Id: fileutl.cc,v 1.28 1999/07/11 22:42:32 jgg Exp $
/* ######################################################################
File Utilities
}
/*}}}*/
-// FileFd::FileFd - Open a file /*{{{*/
+// FileFd::Open - Open a file /*{{{*/
// ---------------------------------------------------------------------
/* The most commonly used open mode combinations are given with Mode */
-FileFd::FileFd(string FileName,OpenMode Mode, unsigned long Perms)
+bool FileFd::Open(string FileName,OpenMode Mode, unsigned long Perms)
{
+ Close();
Flags = AutoClose;
switch (Mode)
{
}
if (iFd < 0)
- _error->Errno("open","Could not open file %s",FileName.c_str());
- else
- {
- this->FileName = FileName;
- SetCloseExec(iFd,true);
- }
+ return _error->Errno("open","Could not open file %s",FileName.c_str());
+
+ this->FileName = FileName;
+ SetCloseExec(iFd,true);
+ return true;
}
/*}}}*/
// FileFd::~File - Closes the file /*{{{*/