57 lines
1.7 KiB
XML
57 lines
1.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<refentry id="scupdatebinary">
|
|
<refentryinfo><title>OpenSC API Reference</title></refentryinfo>
|
|
<refmeta>
|
|
<refentrytitle>sc_update_binary</refentrytitle>
|
|
<manvolnum>3</manvolnum>
|
|
<refmiscinfo>opensc</refmiscinfo>
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
<refname>sc_update_binary</refname>
|
|
<refpurpose>Write to an existing file</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
<title>Synopsis</title>
|
|
<para>
|
|
<programlisting>
|
|
#include <opensc.h>
|
|
|
|
int sc_update_binary(struct sc_card *card, unsigned int offset,
|
|
const unsigned char *buf, size_t count,
|
|
unsigned long flags);
|
|
</programlisting>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
This function writes <emphasis>count</emphasis> bytes from the buffer pointed to by
|
|
<emphasis>buf</emphasis> to a transparent elementary file (EF) on <emphasis>card</emphasis>. It
|
|
corresponds to the ISO 7816 UPDATE BINARY function. Call <link
|
|
linkend="scselectfile">sc_select_file()</link> first to select the file to write to.
|
|
</para>
|
|
|
|
<para>
|
|
This function can only be used to write to a file region previously written to. For writing to a
|
|
newly created file, or a new region of an existing file, use <link
|
|
linkend="scwritebinary">sc_write_binary()</link>.
|
|
</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 written is returned. Otherwise, a negative value is
|
|
returned.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|