2005-03-01 23:33:37 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2005-02-23 02:52:20 +00:00
|
|
|
<refentry id="scselectfile">
|
2005-03-01 23:33:37 +00:00
|
|
|
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
|
2005-02-23 02:52:20 +00:00
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>sc_select_file</refentrytitle>
|
|
|
|
<manvolnum>3</manvolnum>
|
|
|
|
<refmiscinfo>opensc</refmiscinfo>
|
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
|
|
|
<refname>sc_select_file</refname>
|
|
|
|
<refpurpose>Select a file on a smart card</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Synopsis</title>
|
|
|
|
<para>
|
|
|
|
<programlisting>
|
2005-03-01 23:33:37 +00:00
|
|
|
#include <opensc.h>
|
2005-02-23 02:52:20 +00:00
|
|
|
|
|
|
|
int sc_select_file(<link linkend="sccardt">sc_card_t</link> *card,
|
|
|
|
const <link linkend="scpatht">sc_path_t</link> *path,
|
|
|
|
<link linkend="scfilet">sc_file_t</link> **result);
|
|
|
|
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<para>
|
|
|
|
This function selects the file specified by <emphasis>path</emphasis>. If
|
|
|
|
<emphasis>path</emphasis> specifies a file within the currently selected DF, sc_select_file() will
|
|
|
|
<emphasis>not</emphasis> select the MF first, but interpret the path relative to the current DF.
|
|
|
|
It does this in order to prevent losing any authorizations previously established with the card
|
|
|
|
(e.g. by presenting a PIN).
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If <emphasis>result</emphasis> is not NULL, an <link linkend="scfilet">sc_file_t</link> object is
|
|
|
|
created, and the pointer to this object is stored in the location pointed to by
|
|
|
|
<emphasis>result</emphasis>. This handle should later be released using <link
|
|
|
|
linkend="scfilefree">sc_file_free()</link>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Return value</title>
|
|
|
|
<para>
|
|
|
|
If an error occurred, a negative error code is returned. Otherwise, the function will return 0.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|