ePass1000 C/C++ API Reference Manual Version 2.0

# epas_DeleteFile

The epas_DeleteFile function permanently delete a file in the current directory. Applications must have changed current directory to the directory under which file is to be delete by invoking epas_ChangeDir. Application must also have the proper privilege to delete a file.

    EPAS_STATUS EPAS_API
    epas_DeleteFile(
        EPAS_HANDLE hContextHandle,         // [in]
        unsigned long ulFlags,              // [in]
        unsigned long ulFileID              // [in]
    );

#### Requirement

epas_CreateContext, epas_OpenDevice, epas_ChangeDir

#### Parameters

hContextHandle
  [in] Handle to device context.
ulFlags
  [in] Reserved for future extension and must be set to zero.
ulFileID
  [in] ID of the file to be deleted.

#### Remarks

File deletion access is controlled through the Global Access Control of the device. To obtain the Global Access Control, use the epas_GetProperty function. To set the Global Access Control, use the epas_SetProperty function.

For a list of reserved file IDs, see EPAS_FILEINFO.

#### Return Values

If the function succeeds, FT_SUCCESS returned.

If file deletion access is not granted, FT_ACCESS_DENIED is returned.

If a file with the given ID does not exist, FT_FILE_NOT_FOUND is returned.

For a list of all return codes, see Error Code Values.

#### Sample Code

    EPAS_STATUS epsRet;
    EPAS_HANDLE handle;
    .
    .
    .
    epsRet = epas_DeleteFile(handle,0,DEMO_FILE_ID);
    .
    .
    .

#### See Also

epas_CreateFile, epas_OpenFile, epas_CloseFile, epas_GetFileInfo, epas_Read, epas_Write, epas_CreateDir, epas_DeleteDir, epas_GetCurrentDir, epas_ChangeDir, epas_Directory