ePass1000 C/C++ API Reference Manual Version 2.0

# epas_GetFileInfo

The epas_GetFileInfo function retrieve information on a file or directory that is associated with the given ID in the current directory.

    EPAS_STATUS EPAS_API
    epas_GetFileInfo(
        EPAS_HANDLE hContextHandle,      /*[in]*/
        unsigned long ulFlags,           /*[in]*/
        unsigned long ulID,              /*[in]*/
        unsigned char* pucName,          /*[in]*/
        PEPAS_FILEINFO pFileInfo,        /*[out]*/
        unsigned long ulFileInfoSize     /*[in]*/
    );

#### Requirement

epas_CreateContext, epas_OpenDevice

#### Parameters

hContextHandle
  [in] Handle to device context.
ulFlags
  [in] This parameter specifies which file or directory's information is to be returned:

  Flag | Meaning
  --- | ---
  0 | Retrieve information on a file defined by ulID.
  EPAS_DIR_BY_ID | Retrieve information on a directory defined by ulID. The ulID must be a 16-bit directory ID.
  EPAS_DIR_BY_LONG_ID | Retrieve information on a directory defined by ulID.
  EPAS_DIR_BY_NAME | Retrieve information on a directory by Application Directory Name as defined by pucName.
  EPAS_DIR_BY_GUID | Retrieve information on a directory by Application Directory GUID as defined by pucName.
  EPAS_DIR_BY_GUID_STR | Retrieve information on a directory by Application Directory GUID string as defined by pucName.

ulID
  [in] ID of directory or file. This parameter is only valid when ulFlags is set to one of the following flags:

  Flag | Meaning
  --- | ---
  0 | ulID is an integer value in the range of 0 to 0xEFFF.
  EPAS_DIR_BY_ID | ulID is an integer value in the range of 0 to 0xEFFF.

pucName
  [in] Specifies the Application Directory Name or GUID. This parameter is only valid when ulFlags is set to one of the following flags:

  Flag | Meaning
  --- | ---
  EPAS_DIR_BY_NAME | Pointer to a NULL terminate string which defines Directory Application Name. This name must be device unique.
  EPAS_DIR_BY_GUID | Pointer to 16 byte array which defines Directory Application GUID. This GUID must be device unique.
  EPAS_DIR_BY_GUID_STR | Pointer to a NULL terminated string that is the Application Directory GUID of the directory to be retrieved information on. The string format is "{xxxxxxxx - xxxx - xxxx - xxxx - xxxxxxxxxxxx }". Dashes and braces are optional.

pFileInfo
  [out] Pointer to an EPAS_FILEINFOR structure that returns information on the file or directory. It is recommended that zero initialize this structure prior to calling the function.
ulFileInfoSize
  [in] Size of the buffer which pFileInfo points to.

#### Remarks

For directory information, pFileInfo will return the ID of the directory.

For file information, pFileInfo will return access setting for read, write and cryptographic operation. To retrieve granted access rights of a file, you should use epas_OpenFile function with a flag of zero.

This function automatically closes current opened file.

#### Return Values

If the function succeeds, FT_SUCCESS returned.

If the specified file does not exist, FT_FILE_NOT_FOUND is returned.

If the specified directory does not exist, FT_DIR_NOT_FOUND is returned.

For a list of all return codes, see Status Return Values.

#### See Also

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