Contenuto principale

matlab.io.fits.deleteFile

Delete FITS file

Syntax

matlab.io.fits.deleteFile(fptr)

Description

matlab.io.fits.deleteFile(fptr) closes and deletes an open FITS file. This function can be useful if a FITS file cannot be closed properly.

Examples

collapse all

Make a copy of a sample FITS file, open the copy, and then delete the copy. Afterward, check that no open file pointers remain.

import matlab.io.*
copyfile("tst0012.fits","myfile.fits")
fptr = fits.openFile("myfile.fits","readwrite");
fits.deleteFile(fptr)
fptrs = fits.getOpenFiles
fptrs =

  0×0 empty uint64 matrix

Tips

  • This function corresponds to the fits_delete_file (ffdelt) function in the CFITSIO library C API.

  • To use this function, you must be familiar with the CFITSIO C interface. You can access the CFITSIO documentation at the CFITSIO website.

Extended Capabilities

expand all

Version History

expand all