EleFits  5.3.0
A modern C++ API on top of CFITSIO
Loading...
Searching...
No Matches

◆ open()

virtual void open ( const std::string filename,
FileMode  permission 
)
privatevirtual

Open a FITS file with given filename and permission.

This method can only be used after having closed the file; It throws an exception otherwise. This method can be used to change the permission:

... // Write things
f.close();
... // Read things
FITS file reader-writer.
Definition: FitsFile.h:86
std::string filename() const
Get the file name.
@ Create
Create a new file (overwrite forbidden)
@ Read
Open an existing file with read-only permission.

... but not to change the filename: If called with another filename, another FITS file will be opened.

Warning
In any case, relying on the constructors and destructors by managing the object lifetime is preferable.