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
|
.\"Generated by db2man.xsl. Don't modify this, modify the source.
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "SC_WRITE_BINARY" 3 "" "" "OpenSC API Reference"
.SH NAME
sc_write_binary \- Write to a new file
.SH "SYNOPSIS"
.PP
.nf
#include <opensc\&.h>
int sc_write_binary(struct sc_card *card, unsigned int offset,
const unsigned char *buf, size_t count,
unsigned long flags);
.fi
.SH "DESCRIPTION"
.PP
This function writes \fIcount\fR bytes from the buffer pointed to by\fIbuf\fR to a transparent elementary file (EF) on \fIcard\fR\&. It corresponds to the ISO 7816 WRITE BINARY function\&. Call sc_select_file() first to select the file to write to\&.
.PP
This function is used to write to a newly created file, or to a a previously unused portion of a file\&. For updating an existing file, use the sc_update_binary() function\&.
.PP
The \fIoffset\fR argument specifies the file offset in bytes\&. The\fIflags\fR argument is currently not used, and should be set to 0\&.
.SH "RETURN VALUE"
.PP
If successful, the number of bytes written is returned\&. Otherwise, a negative value is returned\&.
|