- 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 wxString& fileName, bool bOverwrite = false,
+ int access = wxS_DEFAULT);
+ bool Open(const wxString& fileName, 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_lasterror = 0; }
+ void Detach() { m_fd = fd_invalid; }
+ int fd() const { return m_fd; }