yaffsfs.c

时间:2022-04-28
本文章向大家介绍yaffsfs.c,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1.int yaffs_write(int fd, const void *buf, unsigned int nbyte)如果一个需要写入文件大于一个chunk咋办呢?(只是将不大于一个chunk的部分写入,那么剩下的咋办?)

2.off_t yaffs_lseek(int fd, off_t offset, int whence)

(1)SEEK_SET=0搜索位置为偏移量offset

(2)SEEK_CUR=1当前位置再加偏移量offset

(3)SEEK_END=2文件长度再加偏移量offset

3. yaffsfs_Lock();//看了半天,原来相当于一个信号量,进行互斥

4.这两个函数的具体区别在哪里

int yaffs_rmdir(const char *path)
{
 return yaffsfs_DoUnlink(path,1);
}
int yaffs_unlink(const char *path)
{
    return yaffsfs_DoUnlink(path,0);
}

5.改变当前状态还是parent状态(我感觉两个正好相反,后面需要test)

int yaffs_stat(const char *path, struct yaffs_stat *buf)
{
    return yaffsfs_DoStatOrLStat(path,buf,0);
}
int yaffs_lstat(const char *path, struct yaffs_stat *buf)
{
    return yaffsfs_DoStatOrLStat(path,buf,1);
} 

6.不用do{} while(0)结构,直接使用条件不就更方便吗?

7.struct yaffs_dirent *yaffs_readdir(yaffs_DIR *dirp)

8.void yaffs_rewinddir(yaffs_DIR *dirp)//返回上一级目录

9.int yaffs_DumpDevStruct(const char *path)