| ePass1000 C/C++ API Reference Manual Version 2.0 |
The epas_DeleteDir function permanently erase a directory and files in the current directory. And it is impossible to recover the removed directory or files.
EPAS_STATUS EPAS_API
epas_DeleteDir(
EPAS_HANDLE hContextHandle, // [in]
unsigned long ulFlags, // [in]
unsigned long ulDirID, // [in]
unsigned char* pucName // [in]
);
epas_CreateContext, epas_OpenDevice
| Flag | Meaning |
|---|---|
| 0 | Delete the directory specified by the ulDirID parameter. The pucName parameter is ignored and should be set to NULL. |
| EPAS_DIR_BY_ID | Delete the directory specified by the ulDirID parameter. If directory ID that given by ulDirID is not a 16-bit ID, invoking will fail. |
| EPAS_DIR_BY_LONG_ID | Delete the directory specified by the ulDirID parameter. |
| EPAS_DIR_BY_NAME | When this flag is set, the pucName parameter points to a NULL terminated string defining the Application Directory Name to delete. |
| EPAS_DIR_BY_GUID | When this flag is set, the pucName parameter points to an array of 16 bytes defining the Application Directory GUID to delete. |
| EPAS_DIR_BY_GUID_STR | When this flag is set, the pucName parameter points to an array of NULL terminate string defining the Application Directory GUID string to delete. |
To format the whole file system, set the directory ID to EPAS_ROOT_DIR and EPAS_DIR_BY_ID flag. This operation requires SO PIN authorization.
For a list of reserved directory IDs, see EPAS_DIRINFO.
If the function succeeds, FT_SUCCESS returned.
If the directory deletion access to the file has not granted, FT_ACCESS_DENIED returned.
If the specified directory does not exist, FT_DIR_NOT_FOUND returned.
For a list of all return codes, see Status Return Values.
EPAS_STATUS epsRet;
EPAS_HANDLE handle;
epsRet = epas_DeleteDir(handle,EPAS_DELETE_RECURSIVE | EPAS_DIR_BY_GUID,
0,(unsigned char*)&guid);
.
.
.
epas_CreateFile, epas_DeleteFile, epas_OpenFile, epas_CloseFile, epas_GetFileInfo, epas_Read, epas_Write, epas_CreateDir, epas_GetCurrentDir, epas_ChangeDir, epas_Directory