|
楼主 |
发表于 2021-7-30 10:57:21
|
显示全部楼层
本帖最后由 tomzbj 于 2021-7-30 11:16 编辑
初步完成基本功能和简单的demo (win32环境, mingw编译)
目前有以下api:
- int zr_init(zr_fs_t* fs);
- int zr_open(zr_fs_t* fs, const char* path);
- int zr_close(zr_fs_t* fs, int fd);
- int zr_read(zr_fs_t* fs, int fd, void* buff, zr_u32_t nbytes);
- int zr_lseek(zr_fs_t* fs, int fd, zr_u32_t offset);
- zr_u32_t zr_tell(zr_fs_t* fs, int fd);
- int zr_stat(zr_fs_t* fs, const char* path, zr_finfo_t* finfo);
- int zr_opendir(zr_fs_t* fs, zr_dir_t* dir, const char* path);
- int zr_readdir(zr_fs_t* fs, zr_dir_t* dir, zr_finfo_t* finfo);
复制代码
用户初始化时提供读函数和起始位置即可.
demo里实现了一个简单的命令行界面, 支持ls, ll, pwd, cd, cat, stat, hexview, crc32, export, help命令。
晚些时候我再移植到stm32+spiflash上试试。
github链接: https://github.com/tomzbj/zromfs |
|