Sortix volatile manual
This manual documents Sortix volatile, a development build that has not been officially released. You can instead view this document in the latest official manual.
NAME
BIO_s_file, BIO_new_file, BIO_new_fp, BIO_set_fp, BIO_get_fp, BIO_read_filename, BIO_write_filename, BIO_append_filename, BIO_rw_filename — FILE BIOSYNOPSIS
#include <openssl/bio.h>BIO_s_file(void);
BIO_new_file(const char *filename, const char *mode);
BIO_new_fp(FILE *stream, int flags);
BIO_set_fp(BIO *b, FILE *fp, int flags);
BIO_get_fp(BIO *b, FILE **fpp);
BIO_read_filename(BIO *b, char *name);
BIO_write_filename(BIO *b, char *name);
BIO_append_filename(BIO *b, char *name);
BIO_rw_filename(BIO *b, char *name);
DESCRIPTION
BIO_s_file() returns the BIO file method. As its name implies, it is a wrapper around the stdio FILE structure and it is a source/sink BIO.
cmd constant |
corresponding macro |
BIO_C_FILE_SEEK | BIO_seek(3) |
BIO_C_FILE_TELL | BIO_tell(3) |
BIO_C_GET_FILE_PTR | BIO_get_fp() |
BIO_C_SET_FILE_PTR | BIO_set_fp() |
BIO_C_SET_FILENAME | various, see below |
BIO_CTRL_EOF | BIO_eof(3) |
BIO_CTRL_FLUSH | BIO_flush(3) |
BIO_CTRL_GET_CLOSE | BIO_get_close(3) |
BIO_CTRL_RESET | BIO_reset(3) |
BIO_CTRL_SET_CLOSE | BIO_set_close(3) |
larg argument |
corresponding macro |
BIO_CLOSE | BIO_FP_READ | BIO_read_filename() |
BIO_CLOSE | BIO_FP_WRITE | BIO_write_filename() |
BIO_CLOSE | BIO_FP_APPEND | BIO_append_filename() |
BIO_CLOSE | BIO_FP_READ | BIO_FP_WRITE | BIO_rw_filename() |
RETURN VALUES
BIO_s_file() returns the file BIO method.EXAMPLES
File BIO "hello world":BIO *bio_out; bio_out = BIO_new_fp(stdout, BIO_NOCLOSE); BIO_printf(bio_out, "Hello World\n");
BIO *bio_out; bio_out = BIO_new(BIO_s_file()); if(bio_out == NULL) /* Error ... */ if(!BIO_set_fp(bio_out, stdout, BIO_NOCLOSE)) /* Error ... */ BIO_printf(bio_out, "Hello World\n");
BIO *out; out = BIO_new_file("filename.txt", "w"); if(!out) /* Error occurred */ BIO_printf(out, "Hello World\n"); BIO_free(out);
BIO *out; out = BIO_new(BIO_s_file()); if(out == NULL) /* Error ... */ if(!BIO_write_filename(out, "filename.txt")) /* Error ... */ BIO_printf(out, "Hello World\n"); BIO_free(out);