In general, CFITSIO places no limits on the sizes of the FITS files that it reads or writes. In particular there is no internal limit on the size of the dimensions of the primary array or IMAGE extension. Tables extensions may have up to 999 columns (the maximum allowed by the FITS standard) and may have an arbitrarily large number of rows. There are a few other limits, however, which may affect some extreme cases:
1. The maximum number of files that may be simultaneously opened is limited to the number of internal IO buffers allocated in CFITSIO (currently 25), or by the limit of the underlying C compiler or machine operating system, which ever is smaller. The C symbolic constant FOPEN_MAX usually defines the total number of files that may open at once (this includes any other text or binary files which may be open, not just FITS files).
2. The maximum number of extensions that can be read or written in a single FITS file is current set to 1000 as defined by MAXHDU in the fitsio.h file. This value may be increased if necessary, but the access times to the later extensions in such files may become very long.
3. CFITSIO can handle FITS files up to about 2.1 GB in size which is the maximum value of a 4-byte signed long integer. Some machines that use 8-byte words for a long integer may support larger files, but this has not been tested.