EleFits  4.0.1
A modern C++ API on top of CFitsIO

◆ open()

void Euclid::Fits::FitsFile::open ( const std::string filename,
FileMode  permission 
)
protected

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:

FitsFile f(filename, FileMode::Create);
... // Write things
f.close();
f.open(filename, FileMode::Read);
... // Read things

... 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.
Euclid::Fits::FitsFile::filename
std::string filename() const
Get the file name.
Euclid::Fits::FitsFile::FitsFile
FitsFile(const std::string &filename, FileMode permission)
Create a new Fits file handler with given filename and permission.