You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each of these functions returns 0 if successful. Otherwise, the function returns -1 and sets errno to EACCES, which means the path specifies a read-only file or a directory, or to ENOENT, which means the file or path isn't found.
The _unlink function deletes the file specified by filename. _wunlink is a wide-character version of _unlink; the filename argument to _wunlink is a wide-character string. These functions behave identically otherwise.
By default, this function's global state is scoped to the application. To change this behavior, see Global state in the CRT.
Generic-text routine mappings
TCHAR.H routine
_UNICODE and _MBCS not defined
_MBCS defined
_UNICODE defined
_tunlink
_unlink
_unlink
_wunlink
Requirements
Routine
Required header
_unlink
<io.h> and <stdio.h>
_wunlink
<io.h> or <wchar.h>
For more compatibility information, see Compatibility.
Code example
This program uses _unlink to delete CRT_UNLINK.TXT.