⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 is_dir.c

📁 MTOOLS version 2.0 Mtools is a public domain collection of programs to allow Unix systems t
💻 C
字号:
/* * Test to see if a filename is a directory.  Subdir() has to be called * on the directory above this one first...  Returns 1 if true. */#include <stdio.h>#include "msdos.h"extern int dir_entries;intis_dir(path)char *path;{	register int entry;	char *newname, *unix_name();	struct directory *dir, *dir_read();					/* no path */	if (*path == '\0')		return(0);	for (entry = 0; entry < dir_entries; entry++) {		dir = dir_read(entry);					/* if empty */		if (dir->name[0] == 0x0)			break;					/* if erased */		if (dir->name[0] == 0xe5)			continue;					/* skip if not a directory */		if (!(dir->attr & 0x10))			continue;		newname = unix_name(dir->name, dir->ext);		if (match(newname, path))			return(1);	}	/*	 * If the file is "." or ".." but it fails to match, then you	 * must be at root	 */	if (!strcmp(path, ".") || !strcmp(path, ".."))		return(1);	return(0);}

⌨️ 快捷键说明

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