---
name: "sc_list_files"
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_list_files"
---

# sc\_list\_files(3)

List files

## NAME

sc\_list\_files - List files

## SYNOPSIS

```
#include <opensc.h>
int sc_list_files(struct sc_card *card, unsigned char *buf, size_t buflen);
```

## DESCRIPTION

This function lists all files in the currently selected DF, and stores the file IDs as big-endian 16-bit words in *buffer*, which is *buflen* bytes long. If the supplied buffer is too small to hold all file IDs, the listing is silently truncated.

## RETURN VALUE

Returns the number of bytes stored in *buffer*, or a negative value in case of error.
