1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
<?xml version="1.0" encoding="UTF-8"?>
<refentry id="screadbinary">
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
<refmeta>
<refentrytitle>sc_read_binary</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>opensc</refmiscinfo>
</refmeta>
<refnamediv>
<refname>sc_read_binary</refname>
<refpurpose>Read a file</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<para>
<programlisting>
#include <opensc.h>
int sc_read_binary(struct sc_card *card, unsigned int offset,
unsigned char *buf, size_t count,
unsigned long flags);
</programlisting>
</para>
</refsect1>
<refsect1>
<title>Description</title>
<para>
This function reads from a transparent elementary file (EF) on <emphasis>card</emphasis>. It
corresponds to the <link linkend="iso7816">ISO 7816</link> READ BINARY function. Call <link
linkend="scselectfile">sc_select_file()</link> first to select the file to read from.
</para>
<para>
The data read from the file is stored in <emphasis>buf</emphasis>, which is
<emphasis>count</emphasis> bytes long.
</para>
<para>
The <emphasis>offset</emphasis> argument specifies the file offset in bytes. The
<emphasis>flags</emphasis> argument is currently not used, and should be set to 0.
</para>
</refsect1>
<refsect1>
<title>Return value</title>
<para>
If successful, the number of bytes read is returned. Otherwise, a negative value is
returned.
</para>
</refsect1>
</refentry>
|