Git Product home page Git Product logo

filesystem-sample's Introduction

filesystem samples package

1、介绍

这个软件包包含了文件系统使用的相关示例代码。

1.1 例程说明

文件 说明
readwrite_sample.c 文件读写
rename_sample.c 更改名称
stat_sample.c 取得状态
mkdir_sample.c 创建目录
opendir_sample.c 打开目录
readdir_sample.c 读取目录
tell_seek_dir_sample.c 保存与设置读取目录位置

1.2 许可证

filesystem samples package 遵循 Apache license v2.0 许可,详见 LICENSE 文件。

1.3 依赖

使用 filesystem samples package 需要在 RT-Thread 的 menuconfig 配置选项中使能文件系统相关功能,具体路径如下:

RT-Thread Components
    device virtual file system --->

2、如何打开 filesystem samples package

使用 filesystem samples package 需要在 RT-Thread 的包管理器中选择它,具体路径如下:

RT-Thread online packages
    miscellaneous packages --->
        samples: kernel and components samples --->
            a filesystem_samples package for rt-thread --->

然后让 RT-Thread 的包管理器自动更新,或者使用 pkgs --update 命令更新包到 BSP 中。

3、使用 filesystem samples package

在打开 filesystem samples package 后,当进行 BSP 编译时,选择的软件包相关源代码会被加入到 BSP 工程中进行编译。

API 列表

API 功能
int open(const char *pathname, int oflag, int mode); 打开文件
int close(int fd); 关闭文件
size_t read(int fd, void *buf, size_t count); 读取数据
size_t write(int fd, const void *buf, size_t count); 写入数据
int rename(const char *oldpath, const char *newpath); 更改名称
int stat(const char *file_name, struct stat *buf); 取得状态
int mkdir(const char *path, mode_t mode); 创建目录
DIR* opendir(const char* name); 打开目录
struct dirent* readdir(DIR *d); 读取目录
off_t telldir(DIR *d); 取得目录流的读取位置
void seekdir(DIR *d, off_t offset); 设置读取目录的位置
void rewinddir(DIR *d); 重设读取目录的位置到开头
int closedir(DIR* d); 关闭目录
int rmdir(const char *pathname); 删除目录
int mkfs(const char * fs_name, const char * device) 格式化文件系统

4、注意事项

暂无。

5、联系方式 & 感谢

filesystem-sample's People

Contributors

armink avatar misonyo avatar summergift avatar yangjie11 avatar yqiu2018 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.