MySQL 9.6.0
Source Code Documentation
s_mysql_mysql_file Struct Reference

File service allows file manipulation depending on the "mysql_file" component service implementation. More...

#include <mysql_file.h>

Public Attributes

FILE_h(* open )(const char *file_name, int open_flags)
 Open a file. More...
 
FILE_h(* create )(const char *file_name, int open_flags, int permission_flags)
 Create a new file. More...
 
int(* close )(FILE_h file)
 Close a file previously opened or created using the open/create functions. More...
 
size_t(* write )(FILE_h file, const unsigned char *data, size_t size)
 Write data into a file. More...
 
size_t(* read )(FILE_h file, unsigned char *data, size_t size)
 Read data from a file. More...
 
int(* flush )(FILE_h file)
 Flush written data into the file. More...
 
unsigned long long(* seek )(FILE_h file, unsigned long long pos, int whence)
 Go to the specified position within a file. More...
 
unsigned long long(* tell )(FILE_h file)
 Get current absolute position within a file. More...
 

Detailed Description

File service allows file manipulation depending on the "mysql_file" component service implementation.

Every function has additional my_flags argument that can be customized depending on the custom implementation.

Member Data Documentation

◆ close

int(* s_mysql_mysql_file::close) (FILE_h file)

Close a file previously opened or created using the open/create functions.

Parameters
fileFile handle.
Returns
Zero value on success, otherwise failed.

◆ create

FILE_h(* s_mysql_mysql_file::create) (const char *file_name, int open_flags, int permission_flags)

Create a new file.

Parameters
file_nameFile path.
open_flagsFile open flags starting with MY_FILE_O prefix, e.g. MY_FILE_O_RDONLY.
permission_flagsFile permission specifier flags starting with MY_FILE_PERMISSION prefix.
Returns
Non zero file handle on success, otherwise failed.

◆ flush

int(* s_mysql_mysql_file::flush) (FILE_h file)

Flush written data into the file.

Parameters
fileFile handle.
Returns
Zero value on success, otherwise failed.

◆ open

FILE_h(* s_mysql_mysql_file::open) (const char *file_name, int open_flags)

Open a file.

Parameters
file_nameFile path.
open_flagsFile open flags starting with MY_FILE_O prefix, e.g. MY_FILE_O_RDONLY.
Returns
Non zero file handle on success, otherwise failed.

◆ read

size_t(* s_mysql_mysql_file::read) (FILE_h file, unsigned char *data, size_t size)

Read data from a file.

Parameters
fileFile handle.
dataData buffer, where data will be written.
sizeData buffer size.
Returns
Number of bytes read.

◆ seek

unsigned long long(* s_mysql_mysql_file::seek) (FILE_h file, unsigned long long pos, int whence)

Go to the specified position within a file.

Parameters
fileFile handle.
posA new read/write position within a file.
whenceFile position flag starting with MY_FILE_SEEK prefix.
Returns
Non MY_FILE_ERROR_POS value on success, otherwise failed.

◆ tell

unsigned long long(* s_mysql_mysql_file::tell) (FILE_h file)

Get current absolute position within a file.

Parameters
fileFile handle.
Returns
Position within a file on success or MY_FILE_ERROR_POS on failure.

◆ write

size_t(* s_mysql_mysql_file::write) (FILE_h file, const unsigned char *data, size_t size)

Write data into a file.

Parameters
fileFile handle.
dataData to be written.
sizeData size.
Returns
Number of bytes written.

The documentation for this struct was generated from the following file: