- bool Create(const char *szFileName, bool bOverwrite = FALSE);
- bool Open(const char *szFileName, OpenMode mode = read);
- void Attach(int fd) { Close(); m_fd = fd; }
- inline void Close(); // Close is a NOP if not opened
+ // create a new file (with the default value of bOverwrite, it will fail if
+ // the file already exists, otherwise it will overwrite it and succeed)
+ bool Create(const wxChar *szFileName, bool bOverwrite = false,
+ int access = wxS_DEFAULT);
+ bool Open(const wxChar *szFileName, OpenMode mode = read,
+ int access = wxS_DEFAULT);
+ bool Close(); // Close is a NOP if not opened
+
+ // assign an existing file descriptor and get it back from wxFile object
+ void Attach(int lfd) { Close(); m_fd = lfd; m_error = false; }
+ void Detach() { m_fd = fd_invalid; }
+ int fd() const { return m_fd; }