As opposed to CFITSIO's HDU counting, the number is not read by this function: it is initialized by the constructor and then updated at each modification through MefFile methods. This way, incomplete HDUs are also taken into account where CFITSIO would exclude them. This means, for example, that the initial number of HDUs in a new file is 1 instead of 0 with CFITSIO.