1SC_WRITE_BINARY(3)           OpenSC API reference           SC_WRITE_BINARY(3)
2
3
4

NAME

6       sc_write_binary - Write to a new file
7

SYNOPSIS

9          #include <opensc.h>
10
11          int sc_write_binary(struct sc_card *card, unsigned int offset,
12                              const unsigned char *buf, size_t count,
13                              unsigned long flags);
14
15
16

DESCRIPTION

18       This function writes count bytes from the buffer pointed to by buf to a
19       transparent elementary file (EF) on card. It corresponds to the ISO
20       7816 WRITE BINARY function. Call sc_select_file() first to select the
21       file to write to.
22
23       This function is used to write to a newly created file, or to a a
24       previously unused portion of a file. For updating an existing file, use
25       the sc_update_binary() function.
26
27       The offset argument specifies the file offset in bytes. The flags
28       argument is currently not used, and should be set to 0.
29

RETURN VALUE

31       If successful, the number of bytes written is returned. Otherwise, a
32       negative value is returned.
33
34
35
36opensc                            05/04/2007                SC_WRITE_BINARY(3)
Impressum