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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? fatfs.c

?? 分享:Dos操作系統(tǒng)的源程序
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
		if(fnp -> f_dir.dir_attrib & ~D_DIR)
		{
			dir_close(fnp);
			return DE_ACCESS;
		}

		/* Check that the directory is empty. Only the  */
		/* "." and ".." are permissable.                */
		fnp -> f_flags.f_dmod = FALSE;
		fnp1 = dir_open((BYTE FAR *)path);
		dir_read(fnp1);
		if(fnp1 -> f_dir.dir_name[0] != '.')
		{
			dir_close(fnp);
			return DE_ACCESS;
		}

		dir_read(fnp1);
		if(fnp1 -> f_dir.dir_name[0] != '.')
		{
			dir_close(fnp);
			return DE_ACCESS;
		}

		/* Now search through the directory and make certain    */
		/* that there are no entries.                           */
		found = FALSE;
		while(dir_read(fnp1) == DIRENT_SIZE)
		{
			if(fnp1 -> f_dir.dir_name[0] == '\0')
				break;
			if(fnp1 -> f_dir.dir_name[0] == DELETED)
				continue;
			else
			{
				found = TRUE;
				break;
			}
		}

		dir_close(fnp1);
		/* If anything was found, exit with an error.   */
		if(found)
		{
			dir_close(fnp);
			return DE_ACCESS;
		}

		/* Ok, so we can delete. Start out by           */
		/* clobbering all FAT entries for this file     */
		/* (or, in English, truncate the FAT).          */
		wipe_out(fnp);
		fnp -> f_dir.dir_size = 0l;
		*(fnp -> f_dir.dir_name) = DELETED;

		/* The directory has been modified, so set the  */
		/* bit before closing it, allowing it to be     */
		/* updated                                      */
		fnp -> f_flags.f_dmod = TRUE;
		dir_close(fnp);

		/* SUCCESSful completion, return it             */
		return SUCCESS;
	}
	else
	{
		/* No such file, return the error               */
		dir_close(fnp);
		return DE_FILENOTFND;
	}
}


COUNT dos_rename(path1, path2)
BYTE FAR *path1, FAR *path2;
{
	REG struct f_node FAR *fnp1;
	REG struct f_node FAR *fnp2;
	BOOL is_free;

	/* first split the passed target into compnents (i.e. - path to */
	/* new file name and name of new file name                      */
	if((fnp2 = split_path(path2, szSecDirName, szSecFileName, szSecFileExt)) == NULL)
	{
		dir_close(fnp2);
		return DE_PATHNOTFND;
	}

	/* Check that we don't have a duplicate name, so if we find     */
	/* one, it's an error.                                          */
	if(find_fname(fnp2, szSecFileName, szSecFileExt))
	{
		dir_close(fnp2);
		return DE_ACCESS;
	}

	/* next split the passed source into compnents (i.e. - path to  */
	/* old file name and name of old file name                      */
	if((fnp1 = split_path(path1, szPriDirName, szPriFileName, szPriFileExt)) == NULL)
	{
		dir_close(fnp1);
		dir_close(fnp2);
		return DE_PATHNOTFND;
	}

	/* Reset the directory by a close followed by an open           */
	fnp2 -> f_flags.f_dmod = FALSE;
	dir_close(fnp2);
	fnp2 = dir_open((BYTE FAR *)szSecDirName);

	/* Now find a free slot to put the file into.                   */
	/* If it's the root and we don't have room, return an error.    */
	if(!(is_free = find_free(fnp2)) && (fnp2 -> f_flags.f_droot))
	{
		fnp2 -> f_flags.f_dmod = FALSE;
		dir_close(fnp1);
		dir_close(fnp2);
		return DE_TOOMANY;
	}

	/* Otherwise just expand the directory                          */
	else if(!is_free && !(fnp2 -> f_flags.f_droot))
	{
		COUNT ret;

		if(extend_dir(fnp2) != SUCCESS)
			return ret;
	}

	if(!find_fname(fnp1, szPriFileName, szPriFileExt))
	{
		/* No such file, return the error                       */
		dir_close(fnp1);
		dir_close(fnp2);
		return DE_FILENOTFND;
	}

	/* put the fnode's name into the directory.                     */
	fbcopy((BYTE FAR *)szSecFileName,
	 (BYTE FAR *)fnp2 -> f_dir.dir_name, FNAME_SIZE);
	fbcopy((BYTE FAR *)szSecFileExt,
	 (BYTE FAR *)fnp2 -> f_dir.dir_ext, FEXT_SIZE);

	/* Set the fnode to the desired mode                            */
	fnp2 -> f_dir.dir_size = fnp1 -> f_dir.dir_size;
	fnp2 -> f_dir.dir_start = fnp1 -> f_dir.dir_start;
	fnp2 -> f_dir.dir_attrib = fnp1 -> f_dir.dir_attrib;
	fnp2 -> f_dir.dir_time = fnp1 -> f_dir.dir_time;
	fnp2 -> f_dir.dir_date = fnp1 -> f_dir.dir_date;

	/* The directory has been modified, so set the bit before       */
	/* closing it, allowing it to be updated.                       */
	fnp1 -> f_flags.f_dmod = fnp2 -> f_flags.f_dmod = TRUE;
	fnp1 -> f_flags.f_dnew = fnp2 -> f_flags.f_dnew = FALSE;
	fnp1 -> f_flags.f_ddir = fnp2 -> f_flags.f_ddir = TRUE;

	fnp2 -> f_highwater = fnp2 -> f_offset = fnp1 -> f_dir.dir_size;

	/* Ok, so we can delete this one. Save the file info.           */
	fnp1 -> f_dir.dir_size = 0l;
	*(fnp1 -> f_dir.dir_name) = DELETED;

	dir_close(fnp1);
	dir_close(fnp2);

	/* SUCCESSful completion, return it                             */
	return SUCCESS;
}


/*                                                              */
/* wipe out all FAT entries for create, delete, etc.            */
/*                                                              */
static VOID 
wipe_out (struct f_node FAR *fnp)
{
	REG UWORD st, next;
	struct dpb *dpbp = fnp -> f_dpb;

	/* if already free or not valid file, just exit         */
	if((fnp == NULL) || (fnp -> f_dir.dir_start == FREE))
		return;

	/* if there are no FAT entries, just exit               */
	if(fnp -> f_dir.dir_start == FREE)
		return;

	/* Loop from start until either a FREE entry is         */
	/* encountered (due to a fractured file system) of the  */
	/* last cluster is encountered.                         */
	for(st = fnp -> f_dir.dir_start ;
	  st != LONG_LAST_CLUSTER && st != LAST_CLUSTER;)
	{
		/* get the next cluster pointed to              */
		next = next_cluster(dpbp, st);

		/* just exit if a damaged file system exists    */
		if(next == FREE)
			return;

		/* zap the FAT pointed to                       */
		link_fat(dpbp, st, FREE);

		/* and the start of free space pointer          */
		if((dpbp -> dpb_cluster == UNKNCLUSTER)
		 || (dpbp -> dpb_cluster > st))
			dpbp -> dpb_cluster = st;

		/* and just follow the linked list              */
		st = next;
	}
}


static BOOL 
find_free (struct f_node FAR *fnp)
{
	while(dir_read(fnp) == DIRENT_SIZE)
	{
		if(fnp -> f_dir.dir_name[0] == '\0'
		 || fnp -> f_dir.dir_name[0] == DELETED)
		{
			return TRUE;
		}
	}
	return !fnp -> f_flags.f_dfull;
}

/*                                                              */
/* dos_getdate for the file date                                */
/*                                                              */
date dos_getdate()
{
#ifndef NOTIME
# ifndef IPL
	BYTE WeekDay, Month, MonthDay;
	COUNT Year;
	date Date;

	/* First - get the system date set by either the user   */
	/* on start-up or the CMOS clock                        */
	DosGetDate((BYTE FAR *)&WeekDay,
	 (BYTE FAR *)&Month,
	 (BYTE FAR *)&MonthDay,
	 (COUNT FAR *)& Year);
	Date = DT_ENCODE(Month, MonthDay, Year - EPOCH_YEAR);
	return Date;
# else
	return 0;
# endif
#else
	return 0;
#endif
}



/*                                                              */
/* dos_gettime for the file time                                */
/*                                                              */
time dos_gettime()
{
#ifndef NOTIME
# ifndef IPL
	BYTE Hour, Minute, Second, Hundredth;
	time Time;
	BYTE h;
	
	/* First - get the system time set by either the user   */
	/* on start-up or the CMOS clock                        */
	DosGetTime((BYTE FAR *)&Hour,
	 (BYTE FAR *)&Minute,
	 (BYTE FAR *)&Second,
	 (BYTE FAR *)&Hundredth);
	h = Second * 10 + ((Hundredth + 5) / 10);
	Time = TM_ENCODE(Hour, Minute, h);
	return Time;
# else
	return 0;
# endif
#else
	return 0;
#endif
}


#ifndef IPL
/*                                                              */
/* dos_getftime for the file time                               */
/*                                                              */
BOOL dos_getftime(fd, dp, tp)
COUNT fd;
date FAR *dp;
time FAR *tp;
{
	struct f_node FAR *fnp;

	/* Translate the fd into an fnode pointer, since all internal   */
	/* operations are achieved through fnodes.                      */
	fnp = xlt_fd(fd);

	/* If the fd was invalid because it was out of range or the     */
	/* requested file was not open, tell the caller and exit        */
	/* note: an invalid fd is indicated by a 0 return               */
	if(fnp == (struct f_node FAR *)0 || fnp -> f_count <= 0)
		return FALSE;

	/* Get the date and time from the fnode and return              */
	*dp = fnp -> f_dir.dir_date;
	*tp = fnp -> f_dir.dir_time;

	return TRUE;
}


/*                                                              */
/* dos_setftime for the file time                               */
/*                                                              */
BOOL dos_setftime(fd, dp, tp)
COUNT fd;
date FAR *dp;
time FAR *tp;
{
	struct f_node FAR *fnp;

	/* Translate the fd into an fnode pointer, since all internal   */
	/* operations are achieved through fnodes.                      */
	fnp = xlt_fd(fd);

	/* If the fd was invalid because it was out of range or the     */
	/* requested file was not open, tell the caller and exit        */
	/* note: an invalid fd is indicated by a 0 return               */
	if(fnp == (struct f_node FAR *)0 || fnp -> f_count <= 0)
		return FALSE;

	/* Set the date and time from the fnode and return              */
	fnp -> f_dir.dir_date = *dp;
	fnp -> f_dir.dir_time = *tp;

	return TRUE;
}


/*                                                              */
/* dos_getfsize for the file time                               */
/*                                                              */
LONG 
dos_getcufsize (COUNT fd)
{
	struct f_node FAR *fnp;

	/* Translate the fd into an fnode pointer, since all internal   */
	/* operations are achieved through fnodes.                      */
	fnp = xlt_fd(fd);

	/* If the fd was invalid because it was out of range or the     */
	/* requested file was not open, tell the caller and exit        */
	/* note: an invalid fd is indicated by a 0 return               */
	if(fnp == (struct f_node FAR *)0 || fnp -> f_count <= 0)
		return -1l;

	/* Return the file size                                         */
	return fnp -> f_highwater;
}


/*                                                              */
/* dos_getfsize for the file time                               */
/*                                                              */
LONG 
dos_getfsize (COUNT fd)
{
	struct f_node FAR *fnp;

	/* Translate the fd into an fnode pointer, since all internal   */
	/* operations are achieved through fnodes.                      */
	fnp = xlt_fd(fd);

	/* If the fd was invalid because it was out of range or the     */
	/* requested file was not open, tell the caller and exit        */
	/* note: an invalid fd is indicated by a 0 return               */
	if(fnp == (struct f_node FAR *)0 || fnp -> f_count <= 0)
		return -1l;

	/* Return the file size                                         */
	return fnp -> f_dir.dir_size;
}


/*                                                              */
/* dos_setfsize for the file time                               */
/*                                                              */
BOOL 
dos_setfsize (COUNT fd, LONG size)
{
	struct f_node FAR *fnp;

	/* Translate the fd into an fnode pointer, since all internal   */
	/* operations are achieved through fnodes.                      */
	fnp = xlt_fd(fd);

	/* If the fd was invalid because it was out of range or the     */
	/* requested file was not open, tell the caller and exit        */
	/* note: an invalid fd is indicated by a 0 return               */
	if(fnp == (struct f_node FAR *)0 || fnp -> f_count <= 0)
		return FALSE;

	/* Change the file size                                         */
	fnp -> f_dir.dir_size = size;
	fnp -> f_highwater = size;
	return TRUE;
}
#endif


/*                                                              */
/* Find free cluster in disk FAT table                          */
/*                                                              */
static UWORD 
find_fat_free (struct f_node FAR *fnp)
{
	REG UWORD idx;

	/* Start from optimized lookup point for start of FAT   */
	if(fnp -> f_dpb -> dpb_cluster != UNKNCLUSTER)
		idx =  fnp -> f_dpb -> dpb_cluster;
	else
		idx = 2;

	/* Search the FAT table looking for the first free      */
	/* entry.                                               */
	for( ; idx < fnp -> f_dpb -> dpb_size; idx++)
	{
		if(next_cluster(fnp -> f_dpb, idx) == FREE)
			break;
	}

	/* No empty clusters, disk is FULL!                     */
	if(idx >= fnp -> f_dpb -> dpb_size)
	{
		fnp -> f_dpb -> dpb_cluster = UNKNCLUSTER;
		dir_close(fnp);
		return LONG_LAST_CLUSTER;
	}

	/* return the free entry                                */
	fnp -> f_dpb -> dpb_cluster = idx;
	return idx;
}



/*                                                              */
/* crate a directory - returns success or a negative error      */
/* number                                                       */
/*                                                              */
COUNT 
dos_mkdir (BYTE FAR *dir)
{
	REG struct f_node FAR *fnp;
	REG COUNT idx;
	struct buffer FAR *bp;
	BYTE FAR *p;
	UWORD free_fat;
	UWORD parent;

	/* first split the passed dir into comopnents (i.e. -   */
	/* path to new directory and name of new directory      */
	if((fnp = split_path(dir, szDirName, szFileName, szFileExt)) == NULL)
	{
		dir_close(fnp);
		return DE_PATHNOTFND;
	}

	/* Check that we don't have a duplicate name, so if we  */
	/* find one, it's an error.                             */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩欧美麻豆| 精品欧美一区二区三区精品久久| 日韩片之四级片| 国产精品麻豆一区二区| 老司机午夜精品| 色综合激情久久| 国产婷婷色一区二区三区| 日韩在线卡一卡二| 91在线精品一区二区| 欧美tickle裸体挠脚心vk| 一区二区免费在线播放| 国产一区二区三区最好精华液| 色噜噜狠狠色综合欧洲selulu| 国产欧美综合在线| 美女久久久精品| 欧美亚洲国产怡红院影院| 中文字幕不卡在线播放| 国产真实乱对白精彩久久| 欧美精品少妇一区二区三区| 日韩理论片中文av| 成人教育av在线| 久久精品亚洲麻豆av一区二区 | 日韩欧美精品在线视频| 亚洲国产日韩a在线播放性色| 国产成人精品三级| 精品国产精品网麻豆系列 | 欧美国产精品v| 国内一区二区在线| 宅男噜噜噜66一区二区66| 亚洲欧美视频在线观看视频| 懂色一区二区三区免费观看| 精品国产欧美一区二区| 日韩和的一区二区| 欧美日韩日本视频| 亚洲愉拍自拍另类高清精品| 99精品在线免费| 中文字幕制服丝袜一区二区三区| 国产二区国产一区在线观看| 欧美精品一区二区三区视频| 久久成人久久鬼色| 日韩免费观看2025年上映的电影 | 一区二区三区国产豹纹内裤在线| 99久久er热在这里只有精品15| 日本一区二区三区视频视频| 国产成人亚洲精品青草天美| 久久久高清一区二区三区| 国产精品一区在线| 久久久噜噜噜久久人人看 | 亚洲一级二级在线| 在线亚洲欧美专区二区| 亚洲精品视频一区二区| 欧美亚洲精品一区| 亚洲国产一区视频| 7878成人国产在线观看| 青青草91视频| 精品国产免费人成在线观看| 国产一区二区三区在线看麻豆| 亚洲精品在线观看网站| 国产美女精品人人做人人爽| 欧美国产欧美亚州国产日韩mv天天看完整| 国产成人高清视频| 国产精品嫩草影院av蜜臀| 91视频一区二区| 亚洲一区二区三区四区的| 欧美欧美欧美欧美首页| 免费高清在线视频一区·| 欧美一区二区在线不卡| 久久精品99国产精品| 日本一区二区三区视频视频| 91蜜桃网址入口| 日韩1区2区3区| 久久精品日韩一区二区三区| 成人一级黄色片| 亚洲国产综合在线| 日韩女优电影在线观看| 国产成人精品三级麻豆| 亚洲已满18点击进入久久| 欧美精品乱码久久久久久按摩 | 亚洲精品乱码久久久久久久久| 欧美日韩在线亚洲一区蜜芽| 日本 国产 欧美色综合| 国产三级精品三级| 色一情一乱一乱一91av| 婷婷丁香激情综合| 国产婷婷色一区二区三区| 不卡一区二区在线| 亚洲一区二区欧美日韩| 日韩欧美一二三| 国产成人精品网址| 亚洲三级免费电影| 欧美人动与zoxxxx乱| 久久97超碰色| 欧美经典一区二区三区| 色老综合老女人久久久| 亚洲一区二区中文在线| 久久综合九色欧美综合狠狠| 从欧美一区二区三区| 一区二区欧美国产| 日韩一二三四区| 国产suv一区二区三区88区| 亚洲日本一区二区| 欧美日韩一区二区三区视频 | 精品国产一区二区三区不卡| 国产成人在线色| 一区二区三区久久| 日韩欧美在线综合网| 成人精品一区二区三区中文字幕| 亚洲免费资源在线播放| 欧美自拍丝袜亚洲| 国产精品18久久久久久久久| 亚洲欧美另类小说| 日韩欧美国产综合| a4yy欧美一区二区三区| 视频一区二区欧美| 国产人久久人人人人爽| 欧美在线色视频| 国产专区综合网| 亚洲国产欧美在线| 久久精品亚洲国产奇米99| 一本一道久久a久久精品综合蜜臀| 日本中文字幕不卡| 久久亚洲春色中文字幕久久久| 91激情五月电影| 久久66热偷产精品| 一区二区三区不卡在线观看| 欧美精品一区在线观看| 91黄色激情网站| 高清视频一区二区| 另类欧美日韩国产在线| 依依成人精品视频| 久久亚洲精品国产精品紫薇| 色av一区二区| 国内久久精品视频| 亚洲成av人影院在线观看网| 18欧美乱大交hd1984| 日韩久久久精品| 在线观看精品一区| 国产成人亚洲综合a∨婷婷| 日韩高清不卡一区二区三区| 18成人在线视频| 日韩一级视频免费观看在线| 欧美视频在线播放| www.亚洲激情.com| 国产在线精品免费| 亚洲成人一区在线| 亚洲欧洲成人精品av97| 欧美成人aa大片| 色94色欧美sute亚洲线路一久| 国产盗摄女厕一区二区三区| 视频在线在亚洲| a在线播放不卡| 国内偷窥港台综合视频在线播放| 日韩va亚洲va欧美va久久| 亚洲美女视频在线| 久久品道一品道久久精品| 欧美大尺度电影在线| 欧美日精品一区视频| 一本一道久久a久久精品综合蜜臀 一本一道综合狠狠老 | 国产成人在线视频播放| 久久99精品一区二区三区三区| 亚洲欧美日韩成人高清在线一区| 国产精品国产三级国产普通话三级 | 久久久久久久久久电影| 日韩精品一区二区三区在线 | 国产精品久久福利| 国产天堂亚洲国产碰碰| 精品免费一区二区三区| 欧美不卡一二三| 日韩写真欧美这视频| 色综合婷婷久久| 色一情一伦一子一伦一区| 国产成人免费视频| 国产尤物一区二区在线| 美女视频黄 久久| 美女视频免费一区| 麻豆精品久久久| 国产精品一卡二卡| 国精产品一区一区三区mba视频 | 7777精品伊人久久久大香线蕉完整版 | 国产亚洲一区二区三区在线观看 | 美女视频网站黄色亚洲| 久久成人免费电影| 日本亚洲三级在线| 久久不见久久见免费视频7| 美女一区二区久久| 极品少妇一区二区三区精品视频| 午夜a成v人精品| 美女视频黄 久久| 国模一区二区三区白浆| 成人18视频在线播放| 色综合网站在线| 欧美主播一区二区三区美女| 欧美综合视频在线观看| 欧美日本在线视频| 日韩精品一区二区三区在线播放 | 色综合久久66| 欧美视频中文字幕| 日韩一区二区在线免费观看| 91精品国产手机| 久久精品夜夜夜夜久久|