---
name: "sc_file"
section: "3"
platform: "linux"
package: "libopensc1-dev"
version: "0.9.6-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_file"
---

# sc\_file(3)

OpenSC file struct

## NAME

sc\_file - OpenSC file struct

## SYNOPSIS

```
#include <opensc.h>

typedef struct sc_file {
        struct sc_path    path;
        int               type, ef_structure;
        size_t            size;
        int               id;
        /* record structured files only */
        int               record_length;
        int               record_count;
} sc_file_t;
```

## DESCRIPTION

This structure describes a file object on a smart card. It contains the following members:

- **path**

  This is the full path to the file, starting at the MF.

- **type**

  This is the file type. If can be one of **SC\_FILE\_TYPE\_DF**, **SC\_FILE\_TYPE\_WORKING\_EF**, or **SC\_FILE\_TYPE\_INTERNAL\_EF**. The latter is used by some cards only, and you normally shouldn't have to deal with these files.

- **ef\_structure**

  For elementary files (EFs), this field describes the file's structure. It can be one of

-

  ```
  SC_FILE_EF_TRANSPARENT
  SC_FILE_EF_LINEAR_FIXED
  SC_FILE_EF_LINEAR_FIXED_TLV
  SC_FILE_EF_LINEAR_VARIABLE
  SC_FILE_EF_LINEAR_VARIABLE_TLV
  SC_FILE_EF_CYCLIC
  SC_FILE_EF_CYCLIC_TLV
  SC_FILE_EF_UNKNOWN
  ```

- **size**

  gives the file's size in bytes.

- **id**

  gives the file's ID, as a 16bit number.

- **record\_count**, **record\_length**

  For record structured files, **record\_count** specifies the number of records in the file. For files with fixed length records, **record\_length** contains the record length.

## SEE ALSO

**sc\_path**(3), [**sc\_file\_new**(3)](/sc_file_new/3.md), [**sc\_file\_free**(3)](/sc_file_free/3.md), [**sc\_select\_file**(3)](/sc_select_file/3.md).

## AUTHOR

This manual page was written by Olaf Kirch \<okir@suse.de\>
