Creating and Deleting Files

To create a new file, specify the MMIO_CREATE option with the mmioOpen function. For example, the following code fragment creates a new file and opens it for both reading and writing:

HMMIO hFile;
.
.
.
hFile = mmioOpen("NEWFILE.TXT", NULL, MMIO_CREATE | MMIO_READWRITE);
if (hFile != NULL)
        /* File created successfully */

else
        /* File could not be created */

Note:

If the file you are creating already exists, it will be truncated to zero length.

To delete a file, specify the MMIO_DELETE flag with the mmioOpen function. Once you delete a file, it can't be recovered (except possibly by using certain MS-DOS based file recovery utilities). If the file deletion is the result of a request from a user, you should always query the user to be sure the user wants to delete the specified file before actually deleting it.