Share via


Closing a File (Windows Embedded CE 6.0)

1/6/2010

To use OS resources efficiently, an application should close files when they are no longer needed by using the CloseHandle function. If a file is open when an application terminates, the system closes it automatically.

The following example closes the file named Myfile.txt, whose handle is stored in the hFile variable.

CloseHandle(hFile);

Closing a file does not delete the file from disk. For more information, see Deleting a File or a Directory.

See Also

Reference

CloseHandle

Concepts

Creating, Deleting, and Maintaining Files