opensc/docs/sc_select_file.3

39 lines
1.3 KiB
Groff

.TH sc_select_file 3 "April 2003" "OpenSC Programmer's Manual
.SH NAME
sc_select_file \- select a file on a smart card
.SH SYNOPSIS
.nf
.B #include <opensc.h>
.sp
.BI "int sc_select_file(sc_card_t *" card ",
.BI " const sc_path_t *" path ",
.BI " sc_file_t ** "result ");
.fi
.SH DESCRIPTION
This function selects the file specified by \fIpath\fP.
If \fIpath\fP specifies a file within the currently selected
DF, \fBsc_select_file\fP will \fInot\fP 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).
.PP
If \fIresult\fP is not NULL, an \fBsc_file\fP(3) object is
created, and the pointer to this object is stored in the
location pointed to by \fIresult\fP. This handle should later
be released using \fBsc_file_free\fP(3).
.SH RETURN VALUE
If an error occurred, a negative error code is returned, as described
in \fbsc_error\fP(3). Otherwise, the function will return 0.
.SH SEE ALSO
.BR sc_file (3),
.BR sc_path (3),
.BR sc_establish_context (3),
.BR sc_file_free (3),
.BR sc_read_binary (3),
.BR sc_read_record (3),
.BR sc_delete_file (3),
.BR sc_list_files (3),
.BR sc_create_file (3).
.SH AUTHOR
This manual page was written by Olaf Kirch <okir@suse.de>