diff options
Diffstat (limited to 'lib/common/FileStream.h')
-rw-r--r-- | lib/common/FileStream.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/common/FileStream.h b/lib/common/FileStream.h index 5efb91ea..e3ab9f46 100644 --- a/lib/common/FileStream.h +++ b/lib/common/FileStream.h @@ -38,6 +38,18 @@ public: int flags = O_RDONLY, #endif int mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)); + + // Ensure that const char * name doesn't end up as a handle + // on Windows! + + FileStream(const char *pFilename, +#ifdef WIN32 + int flags = (O_RDONLY | O_BINARY), +#else + int flags = O_RDONLY, +#endif + int mode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)); + FileStream(tOSFileHandle FileDescriptor); virtual ~FileStream(); @@ -56,6 +68,7 @@ private: tOSFileHandle mOSFileHandle; bool mIsEOF; FileStream(const FileStream &rToCopy) { /* do not call */ } + void AfterOpen(); // for debugging.. std::string mFileName; |