readme.txt

来自「kfs嵌入式文件系统1.0.1release版 作者:Eagle 来源:ht」· 文本 代码 · 共 72 行

TXT
72
字号
About KFS file system

version : 1.0.1 release

author : eagle

web : www.embseek.com

date: 2007-7-02

files:
	/kfs.h
	/kfs.c		core of the kfs
	/str.h
	/str.c		string apis
	/kfsdev.h
	/kfsdev.c	example device of the file system ,build kfs in ram

	/main.c 	example in pc with example device
	/makefile	example makefile
	
how to use:

1.include the "kfs.h" headfile in your program

		#include "kfs.h"
	
2.init the filesystem
		.....
			
		r_fsinit(start_address,end_address);	//init the file system
				//to use start_address and end_address of the file system

		.....
		
		
3.create a file and to write something to it
		.....
		
		r_FILE * fp;
		
		
		fp=r_fopen("abc",O_CREAT); 		//create a file ,filename is "abc",access mode is O_CREAT.
			
		if(fp){			//please chech if the file is open succeed
			u8 ret=0;
			ret=r_fputc(fp,0x02);		//put a character to the file
		}
		
		r_fclose(&fp);					//close the file
	
		.....

4.open a file to read something
	
			.....
		
		r_FILE * fp;
		
		
		fp=r_fopen("abc",O_CREAT); 		//create a file ,filename is "abc",access mode is O_CREAT.
			
		if(fp){				//please chech if the file is open succeed	
			u8 ret=0;
			ret=r_fgetc(fp);		//read a character from the file
		}
		
		r_fclose(&fp);					//close the file
	
		.....
		

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?