1SC_WRITE_RECORD(3) OpenSC API reference SC_WRITE_RECORD(3)
2
3
4
6 sc_write_record - Write a record to a file
7
9 #include <opensc.h>
10
11 int sc_write_record(struct sc_card *card, unsigned int record,
12 const unsigned char *buf, size_t buflen,
13 unsigned long flags);
14
15
16
18 This function writes a record that is buflen bytes long from the buffer
19 pointed to by buf to a record-structured elementary file (EF) on card.
20 The function corresponds to the ISO 7816 WRITE RECORD function. Call
21 sc_select_file() first to select the file to write to.
22
23 record specifies the ID of the record to be written, or, if flags is
24 set to SC_RECORD_BY_REC_NR, the record number. If record is set to
25 zero, the current record will be read.
26
27 This function is used for newly created files only; for updating or
28 appending to existing files, see the sc_update_record() and
29 sc_append_record() functions, respectively.
30
32 Returns the number of bytes written if successful, or a negative value
33 in case of error.
34
35
36
37opensc 02/16/2010 SC_WRITE_RECORD(3)