---
name: "sc_file_t"
section: "3"
platform: "linux"
package: "libopensc2-dev"
version: "0.11.13-1.1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_file_t"
---

# sc\_file\_t(3)

OpenSC file structure

## NAME

sc\_file\_t - OpenSC file structure

## 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 full the path to the file, starting at the MF.

*type*

This is the file type. It 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 16-bit number.

*record\_count, record\_length*

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