RT-Thread RTOS  1.0.0
An open source embedded real-time operating system
File System API

Functions

int dfs_register (const struct dfs_filesystem_operation *ops)
struct dfs_filesystem * dfs_filesystem_lookup (const char *path)
rt_err_t dfs_filesystem_get_partition (struct dfs_partition *part, rt_uint8_t *buf, rt_uint32_t pindex)
int dfs_mount (const char *device_name, const char *path, const char *filesystemtype, unsigned long rwflag, const void *data)
int dfs_unmount (const char *specialfile)
int dfs_mkfs (const char *fs_name, const char *device_name)
int dfs_statfs (const char *path, struct statfs *buffer)

Function Documentation

int dfs_register ( const struct dfs_filesystem_operation *  ops)

this function will register a file system instance to device file system.

Parameters:
opsthe file system instance to be registered.
Returns:
0 on sucessful, -1 on failed.
struct dfs_filesystem* dfs_filesystem_lookup ( const char *  path) [read]

this function will return the file system mounted on specified path.

Parameters:
paththe specified path string.
Returns:
the found file system or NULL if no file system mounted on specified path
rt_err_t dfs_filesystem_get_partition ( struct dfs_partition *  part,
rt_uint8_t buf,
rt_uint32_t  pindex 
)

this function will fetch the partition table on specified buffer.

Parameters:
partthe returned partition structure.
bufthe buffer contains partition table.
pindexthe index of partition table to fetch.
Returns:
RT_EOK on successful or -RT_ERROR on failed.
int dfs_mount ( const char *  device_name,
const char *  path,
const char *  filesystemtype,
unsigned long  rwflag,
const void *  data 
)

this function will mount a file system on a specified path.

Parameters:
device_namethe name of device which includes a file system.
paththe path to mount a file system
filesystemtypethe file system type
rwflagthe read/write etc. flag.
datathe private data(parameter) for this file system.
Returns:
0 on successful or -1 on failed.
int dfs_unmount ( const char *  specialfile)

this function will umount a file system on specified path.

Parameters:
specialfilethe specified path which mounted a file system.
Returns:
0 on successful or -1 on failed.
int dfs_mkfs ( const char *  fs_name,
const char *  device_name 
)

make a file system on the special device

Parameters:
fs_namethe file system name
device_namethe special device name
Returns:
0 on successful, otherwise failed.
int dfs_statfs ( const char *  path,
struct statfs buffer 
)

this function will return the information about a mounted file system.

Parameters:
paththe path which mounted file system.
bufferthe buffer to save the returned information.
Returns:
0 on successful, others on failed.
 All Data Structures Variables