亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tff.c

?? FAT File System Module new rev
?? C
?? 第 1 頁 / 共 4 頁
字號:

	*nclust = n;
	return FR_OK;
}




/*-----------------------------------------------------------------------*/
/* Delete a File or Directory                                            */
/*-----------------------------------------------------------------------*/

FRESULT f_unlink (
	const char *path		/* Pointer to the file or directory path */
)
{
	FRESULT res;
	DIR dj;
	BYTE *dir, *sdir;
	DWORD dsect;
	char fn[8+3+1];
	CLUST dclust;


	res = auto_mount(&path, 1);
	if (res != FR_OK) return res;
	res = trace_path(&dj, fn, path, &dir);	/* Trace the file path */
	if (res != FR_OK) return res;			/* Trace failed */
	if (!dir) return FR_INVALID_NAME;		/* It is the root directory */
	if (dir[DIR_Attr] & AM_RDO) return FR_DENIED;	/* It is a R/O object */
	dsect = dj.fs->winsect;
	dclust =
#if _FAT32
		((DWORD)LD_WORD(&dir[DIR_FstClusHI]) << 16) |
#endif
		LD_WORD(&dir[DIR_FstClusLO]);
	if (dir[DIR_Attr] & AM_DIR) {			/* It is a sub-directory */
		dj.clust = dclust;					/* Check if the sub-dir is empty or not */
		dj.sect = clust2sect(dclust);
		dj.index = 2;
		do {
			if (!move_window(dj.sect)) return FR_RW_ERROR;
			sdir = &dj.fs->win[(dj.index & 15) * 32];
			if (sdir[DIR_Name] == 0) break;
			if (sdir[DIR_Name] != 0xE5 && !(sdir[DIR_Attr] & AM_VOL))
				return FR_DENIED;	/* The directory is not empty */
		} while (next_dir_entry(&dj));
	}

	if (!move_window(dsect)) return FR_RW_ERROR;	/* Mark the directory entry 'deleted' */
	dir[DIR_Name] = 0xE5;
	dj.fs->winflag = 1;
	if (!remove_chain(dclust)) return FR_RW_ERROR;	/* Remove the cluster chain */

	return sync();
}




/*-----------------------------------------------------------------------*/
/* Create a Directory                                                    */
/*-----------------------------------------------------------------------*/

FRESULT f_mkdir (
	const char *path		/* Pointer to the directory path */
)
{
	FRESULT res;
	DIR dj;
	BYTE *dir, *fw, n;
	char fn[8+3+1];
	DWORD sect, dsect, tim;
	CLUST dclust, pclust;


	res = auto_mount(&path, 1);
	if (res != FR_OK) return res;
	res = trace_path(&dj, fn, path, &dir);	/* Trace the file path */
	if (res == FR_OK) return FR_EXIST;		/* Any file or directory is already existing */
	if (res != FR_NO_FILE) return res;

	res = reserve_direntry(&dj, &dir); 		/* Reserve a directory entry */
	if (res != FR_OK) return res;
	sect = dj.fs->winsect;
	dclust = create_chain(0);				/* Allocate a cluster for new directory table */
	if (dclust == 1) return FR_RW_ERROR;
	dsect = clust2sect(dclust);
	if (!dsect) return FR_DENIED;
	if (!move_window(dsect)) return FR_RW_ERROR;

	fw = dj.fs->win;
	memset(fw, 0, 512U);					/* Clear the directory table */
	for (n = 1; n < dj.fs->csize; n++) {
		if (disk_write(0, fw, ++dsect, 1) != RES_OK)
			return FR_RW_ERROR;
	}

	memset(&fw[DIR_Name], ' ', 8+3);		/* Create "." entry */
	fw[DIR_Name] = '.';
	fw[DIR_Attr] = AM_DIR;
	tim = get_fattime();
	ST_DWORD(&fw[DIR_WrtTime], tim);
	memcpy(&fw[32], &fw[0], 32); fw[33] = '.';	/* Create ".." entry */
	pclust = dj.sclust;
#if _FAT32
	ST_WORD(&fw[   DIR_FstClusHI], dclust >> 16);
	if (dj.fs->fs_type == FS_FAT32 && pclust == dj.fs->dirbase) pclust = 0;
	ST_WORD(&fw[32+DIR_FstClusHI], pclust >> 16);
#endif
	ST_WORD(&fw[   DIR_FstClusLO], dclust);
	ST_WORD(&fw[32+DIR_FstClusLO], pclust);
	dj.fs->winflag = 1;

	if (!move_window(sect)) return FR_RW_ERROR;
	memset(&dir[0], 0, 32);						/* Clean-up the new entry */
	memcpy(&dir[DIR_Name], fn, 8+3);			/* Name */
	dir[DIR_NTres] = fn[11];
	dir[DIR_Attr] = AM_DIR;						/* Attribute */
	ST_DWORD(&dir[DIR_WrtTime], tim);			/* Crated time */
	ST_WORD(&dir[DIR_FstClusLO], dclust);		/* Table start cluster */
#if _FAT32
	ST_WORD(&dir[DIR_FstClusHI], dclust >> 16);
#endif

	return sync();
}




/*-----------------------------------------------------------------------*/
/* Change File Attribute                                                 */
/*-----------------------------------------------------------------------*/

FRESULT f_chmod (
	const char *path,	/* Pointer to the file path */
	BYTE value,			/* Attribute bits */
	BYTE mask			/* Attribute mask to change */
)
{
	FRESULT res;
	DIR dj;
	BYTE *dir;
	char fn[8+3+1];


	res = auto_mount(&path, 1);
	if (res == FR_OK) {
		res = trace_path(&dj, fn, path, &dir);	/* Trace the file path */
		if (res == FR_OK) {				/* Trace completed */
			if (!dir) {
				res = FR_INVALID_NAME;	/* Root directory */
			} else {
				mask &= AM_RDO|AM_HID|AM_SYS|AM_ARC;	/* Valid attribute mask */
				dir[DIR_Attr] = (value & mask) | (dir[DIR_Attr] & (BYTE)~mask);	/* Apply attribute change */
				res = sync();
			}
		}
	}
	return res;
}




/*-----------------------------------------------------------------------*/
/* Change Timestamp                                                      */
/*-----------------------------------------------------------------------*/

FRESULT f_utime (
	const char *path,		/* Pointer to the file/directory name */
	const FILINFO *finfo	/* Pointer to the timestamp to be set */
)
{
	FRESULT res;
	DIR dj;
	BYTE *dir;
	char fn[8+3+1];


	res = auto_mount(&path, 1);
	if (res == FR_OK) {
		res = trace_path(&dj, fn, path, &dir);	/* Trace the file path */
		if (res == FR_OK) {				/* Trace completed */
			if (!dir) {
				res = FR_INVALID_NAME;	/* Root directory */
			} else {
				ST_WORD(&dir[DIR_WrtTime], finfo->ftime);
				ST_WORD(&dir[DIR_WrtDate], finfo->fdate);
				res = sync();
			}
		}
	}
	return res;
}




/*-----------------------------------------------------------------------*/
/* Rename File/Directory                                                 */
/*-----------------------------------------------------------------------*/

FRESULT f_rename (
	const char *path_old,	/* Pointer to the old name */
	const char *path_new	/* Pointer to the new name */
)
{
	FRESULT res;
	DWORD sect_old;
	BYTE *dir_old, *dir_new, direntry[32-11];
	DIR dj;
	char fn[8+3+1];


	res = auto_mount(&path_old, 1);
	if (res != FR_OK) return res;

	res = trace_path(&dj, fn, path_old, &dir_old);	/* Check old object */
	if (res != FR_OK) return res;				/* The old object is not found */
	if (!dir_old) return FR_NO_FILE;
	sect_old = dj.fs->winsect;					/* Save the object information */
	memcpy(direntry, &dir_old[DIR_Attr], 32-11);

	res = trace_path(&dj, fn, path_new, &dir_new);	/* Check new object */
	if (res == FR_OK) return FR_EXIST;			/* The new object name is already existing */
	if (res != FR_NO_FILE) return res;			/* Is there no old name? */
	res = reserve_direntry(&dj, &dir_new); 		/* Reserve a directory entry */
	if (res != FR_OK) return res;

	memcpy(&dir_new[DIR_Attr], direntry, 32-11);	/* Create new entry */
	memcpy(&dir_new[DIR_Name], fn, 8+3);
	dir_new[DIR_NTres] = fn[11];
	dj.fs->winflag = 1;

	if (!move_window(sect_old)) return FR_RW_ERROR;	/* Delete old entry */
	dir_old[DIR_Name] = 0xE5;

	return sync();
}

#endif /* !_FS_READONLY */
#endif /* _FS_MINIMIZE == 0 */
#endif /* _FS_MINIMIZE <= 1 */
#endif /* _FS_MINIMIZE <= 2 */


#if _USE_FORWARD
/*-----------------------------------------------------------------------*/
/* Forward data to the stream directly                                   */
/*-----------------------------------------------------------------------*/

FRESULT f_forward (
	FIL *fp, 						/* Pointer to the file object */
	UINT (*func)(const BYTE*,UINT),	/* Pointer to the streaming function */
	UINT btr,						/* Number of bytes to forward */
	UINT *br						/* Pointer to number of bytes forwarded */
)
{
	FRESULT res;
	DWORD remain;
	UINT rcnt;
	CLUST clust;


	*br = 0;
	res = validate(fp->fs, fp->id);					/* Check validity of the object */
	if (res != FR_OK) return res;
	if (fp->flag & FA__ERROR) return FR_RW_ERROR;	/* Check error flag */
	if (!(fp->flag & FA_READ)) return FR_DENIED;	/* Check access mode */
	remain = fp->fsize - fp->fptr;
	if (btr > remain) btr = (UINT)remain;			/* Truncate btr by remaining bytes */

	for ( ;  btr && (*func)(NULL, 0);				/* Repeat until all data transferred */
		fp->fptr += rcnt, *br += rcnt, btr -= rcnt) {
		if ((fp->fptr % 512U) == 0) {				/* On the sector boundary? */
			if (fp->csect >= fp->fs->csize) {		/* On the cluster boundary? */
				clust = (fp->fptr == 0) ?			/* On the top of the file? */
					fp->org_clust : get_cluster(fp->curr_clust);
				if (clust < 2 || clust >= fp->fs->max_clust) goto ff_error;
				fp->curr_clust = clust;				/* Update current cluster */
				fp->csect = 0;						/* Reset sector address in the cluster */
			}
			fp->csect++;							/* Next sector address in the cluster */
		}
		if (!move_window(clust2sect(fp->curr_clust) + fp->csect - 1))	/* Move sector window */
			goto ff_error;
		rcnt = 512U - (WORD)(fp->fptr % 512U);		/* Forward data from sector window */
		if (rcnt > btr) rcnt = btr;
		rcnt = (*func)(&fp->fs->win[(WORD)fp->fptr % 512U], rcnt);
		if (rcnt == 0) goto ff_error;
	}

	return FR_OK;

ff_error:	/* Abort this function due to an unrecoverable error */
	fp->flag |= FA__ERROR;
	return FR_RW_ERROR;
}
#endif /* _USE_FORWARD */



#if _USE_STRFUNC >= 1
/*-----------------------------------------------------------------------*/
/* Get a string from the file                                            */
/*-----------------------------------------------------------------------*/
char* fgets (
	char* buff,	/* Pointer to the string buffer to read */
	int len,	/* Size of string buffer */
	FIL* fil	/* Pointer to the file object */
)
{
	int i = 0;
	char *p = buff;
	UINT rc;


	while (i < len - 1) {			/* Read bytes until buffer gets filled */
		f_read(fil, p, 1, &rc);
		if (rc != 1) break;			/* Break when no data to read */
#if _USE_STRFUNC >= 2
		if (*p == '\r') continue;	/* Strip '\r' */
#endif
		i++;
		if (*p++ == '\n') break;	/* Break when reached end of line */
	}
	*p = 0;
	return i ? buff : 0;			/* When no data read (eof or error), return with error. */
}



#if !_FS_READONLY
#include <stdarg.h>
/*-----------------------------------------------------------------------*/
/* Put a character to the file                                           */
/*-----------------------------------------------------------------------*/
int fputc (
	int chr,	/* A character to be output */
	FIL* fil	/* Ponter to the file object */
)
{
	UINT bw;
	char c;


#if _USE_STRFUNC >= 2
	if (chr == '\n') fputc ('\r', fil);	/* LF -> CRLF conversion */
#endif
	if (!fil) {	/* Special value may be used to switch the destination to any other device */
	/*	put_console(chr);	*/
		return chr;
	}
	c = (char)chr;
	f_write(fil, &c, 1, &bw);	/* Write a byte to the file */
	return bw ? chr : EOF;		/* Return the resulut */
}




/*-----------------------------------------------------------------------*/
/* Put a string to the file                                              */
/*-----------------------------------------------------------------------*/
int fputs (
	const char* str,	/* Pointer to the string to be output */
	FIL* fil			/* Pointer to the file object */
)
{
	int n;


	for (n = 0; *str; str++, n++) {
		if (fputc(*str, fil) == EOF) return EOF;
	}
	return n;
}




/*-----------------------------------------------------------------------*/
/* Put a formatted string to the file                                    */
/*-----------------------------------------------------------------------*/
int fprintf (
	FIL* fil,			/* Pointer to the file object */
	const char* str,	/* Pointer to the format string */
	...					/* Optional arguments... */
)
{
	va_list arp;
	UCHAR c, f, r;
	ULONG val;
	char s[16];
	int i, w, res, cc;


	va_start(arp, str);

	for (cc = res = 0; cc != EOF; res += cc) {
		c = *str++;
		if (c == 0) break;			/* End of string */
		if (c != '%') {				/* Non escape cahracter */
			cc = fputc(c, fil);
			if (cc != EOF) cc = 1;
			continue;
		}
		w = f = 0;
		c = *str++;
		if (c == '0') {				/* Flag: '0' padding */
			f = 1; c = *str++;
		}
		while (c >= '0' && c <= '9') {	/* Precision */
			w = w * 10 + (c - '0');
			c = *str++;
		}
		if (c == 'l') {				/* Prefix: Size is long int */
			f |= 2; c = *str++;
		}
		if (c == 's') {				/* Type is string */
			cc = fputs(va_arg(arp, char*), fil);
			continue;
		}
		if (c == 'c') {				/* Type is character */
			cc = fputc(va_arg(arp, char), fil);
			if (cc != EOF) cc = 1;
			continue;
		}
		r = 0;
		if (c == 'd') r = 10;		/* Type is signed decimal */
		if (c == 'u') r = 10;		/* Type is unsigned decimal */
		if (c == 'X') r = 16;		/* Type is unsigned hexdecimal */
		if (r == 0) break;			/* Unknown type */
		if (f & 2) {				/* Get the value */
			val = (ULONG)va_arg(arp, long);
		} else {
			val = (c == 'd') ? (ULONG)(long)va_arg(arp, int) : (ULONG)va_arg(arp, unsigned int);
		}
		/* Put numeral string */
		if (c == 'd') {
			if (val >= 0x80000000) {
				val = 0 - val;
				f |= 4;
			}
		}
		i = sizeof(s) - 1; s[i] = 0;
		do {
			c = (UCHAR)(val % r + '0');
			if (c > '9') c += 7;
			s[--i] = c;
			val /= r;
		} while (i && val);
		if (i && (f & 4)) s[--i] = '-';
		w = sizeof(s) - 1 - w;
		while (i && i > w) s[--i] = (f & 1) ? '0' : ' ';
		cc = fputs(&s[i], fil);
	}

	va_end(arp);
	return (cc == EOF) ? cc : res;
}

#endif /* !_FS_READONLY */
#endif /* _USE_STRFUNC >= 1*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区免费看| 亚洲小少妇裸体bbw| 亚洲国产视频在线| 不卡视频免费播放| 日韩欧美在线网站| 亚洲综合免费观看高清完整版 | 337p亚洲精品色噜噜| 中文字幕的久久| 久久成人免费网| 欧美一区二区三区色| 亚洲免费观看视频| 不卡一卡二卡三乱码免费网站| 精品成人在线观看| 午夜成人免费视频| 欧美主播一区二区三区美女| 中文字幕高清不卡| 粉嫩高潮美女一区二区三区| 久久综合狠狠综合久久综合88| 青青草伊人久久| 制服丝袜一区二区三区| 午夜影院在线观看欧美| 在线一区二区视频| 亚洲国产欧美在线| 欧美亚洲自拍偷拍| 午夜精品123| 欧美视频在线不卡| 午夜精品一区二区三区三上悠亚 | av亚洲精华国产精华精华| 久久午夜老司机| 国产精品自在欧美一区| 久久欧美中文字幕| 国产福利视频一区二区三区| 久久久综合视频| 大美女一区二区三区| 国产精品国产三级国产普通话三级| 国产精品1区2区3区| 国产精品国产三级国产aⅴ无密码| 成人福利视频在线看| 综合在线观看色| 欧洲亚洲精品在线| 麻豆精品一二三| 久久久久国产一区二区三区四区| 国产99精品国产| 亚洲女与黑人做爰| 91.com视频| 国模冰冰炮一区二区| 中文字幕一区二区日韩精品绯色| 91久久一区二区| 日韩激情中文字幕| 久久精品一区二区| 在线精品亚洲一区二区不卡| 天天色综合天天| 精品va天堂亚洲国产| 夫妻av一区二区| 最新国产の精品合集bt伙计| 91美女在线看| 亚洲午夜在线电影| 91精品欧美久久久久久动漫| 日韩av在线免费观看不卡| 在线播放91灌醉迷j高跟美女 | 欧美日韩国产大片| 蜜桃一区二区三区四区| 欧美大片日本大片免费观看| 国产中文字幕精品| 中文字幕乱码久久午夜不卡| 91小视频在线观看| 亚洲五月六月丁香激情| 91精品欧美久久久久久动漫| 国内精品不卡在线| 中文字幕一区二区不卡| 欧洲精品中文字幕| 精品写真视频在线观看| 国产女人aaa级久久久级| www.欧美日韩国产在线| 午夜在线成人av| 亚洲精品一区二区三区影院| 99精品视频免费在线观看| 天天影视色香欲综合网老头| 国产亚洲视频系列| 欧美亚洲动漫精品| 国产成人精品亚洲777人妖| 亚洲免费伊人电影| 欧美大片在线观看一区| 一本久久精品一区二区| 麻豆国产精品一区二区三区| 最新国产精品久久精品| 日韩午夜在线影院| 成人高清在线视频| 蜜桃精品在线观看| 日韩伦理电影网| 日韩欧美国产综合| 在线免费精品视频| 风间由美中文字幕在线看视频国产欧美| 一区二区视频在线| 久久久电影一区二区三区| 欧美综合视频在线观看| 国产大陆精品国产| 综合久久综合久久| 亚洲天堂免费在线观看视频| 精品久久久久一区| 欧美日韩国产高清一区| 成人午夜大片免费观看| 久久黄色级2电影| 伊人夜夜躁av伊人久久| 国产精品丝袜黑色高跟| 久久影院电视剧免费观看| 欧美精品久久99| 91蜜桃在线观看| 成人毛片视频在线观看| 国产精品一区二区久久精品爱涩| 视频在线观看国产精品| 亚洲一区影音先锋| 一区二区三区在线观看欧美| 国产精品麻豆视频| 国产亚洲精品超碰| 久久免费美女视频| 欧美成人性福生活免费看| 欧美日韩亚洲综合一区| 色狠狠av一区二区三区| 不卡的av电影在线观看| 99久久久精品| 国产成人亚洲精品狼色在线| 国产乱国产乱300精品| 国内外成人在线视频| 极品少妇一区二区| 激情另类小说区图片区视频区| 亚洲一区免费观看| 全部av―极品视觉盛宴亚洲| 青青草97国产精品免费观看| 日本午夜精品一区二区三区电影| 午夜精品视频一区| 首页国产丝袜综合| 蜜臀久久99精品久久久久宅男| 亚洲成年人网站在线观看| 精品中文字幕一区二区| 九九**精品视频免费播放| 国产一区二区三区在线观看免费| 国产九色精品成人porny| 国产精品一区二区在线看| 成人激情校园春色| 91丝袜美女网| 91精品福利在线一区二区三区 | 日本一区二区高清| 中文字幕一区日韩精品欧美| 亚洲欧美色图小说| 亚洲高清免费视频| 国产一区二区三区免费看| 成人精品电影在线观看| 色94色欧美sute亚洲线路一久| 欧美色综合影院| 欧美哺乳videos| 国产精品久久久久久久浪潮网站 | 国产成人av一区二区三区在线观看| 国产在线国偷精品免费看| 国产在线视频精品一区| 99精品久久久久久| 欧美一区二区三区喷汁尤物| 久久午夜羞羞影院免费观看| 日本一区二区三区四区| 日韩不卡一区二区三区| 成人黄色综合网站| 777xxx欧美| 国产精品女上位| 日韩国产欧美在线观看| 精品夜夜嗨av一区二区三区| 欧美中文一区二区三区| 欧美精品一区二区三区蜜桃视频| 国产精品热久久久久夜色精品三区| 亚洲精品国产a| 国产美女一区二区| 欧美网站一区二区| 久久婷婷久久一区二区三区| 综合精品久久久| 激情小说亚洲一区| 欧美在线制服丝袜| 久久久久久久免费视频了| 亚洲第一二三四区| 国产精品亚洲第一| 欧美二区三区91| ...xxx性欧美| 国产精品77777| 欧美一区二区黄| 1024成人网| 91丨porny丨在线| 久久精品一区二区三区不卡 | 91蝌蚪porny九色| 精品国产污污免费网站入口 | 美日韩一区二区| 日本精品一级二级| 日本一区二区三区免费乱视频| 青青草国产成人99久久| 91麻豆精品在线观看| 欧美mv日韩mv| 日韩av在线播放中文字幕| 色噜噜久久综合| 国产精品久久久久久久蜜臀| 国产精品一区二区免费不卡| 久久亚洲精精品中文字幕早川悠里| 轻轻草成人在线| 在线播放/欧美激情|