通配符的 C 语言源代码
/* find files from wildcards, for MicroSoft C v4.0 */
/* ------------------------------------------------------------ */
/* copyright 1986: */
/* Nourse Gregg & Browne, Inc. */
/* 1 Horizon Road. #612 */
/* Fort Lee, NJ 07024 */
/* */
/* ------------------------------------------------------------ */
/* ----------------------------------------------------------------------*
This pair of routines will do a wildcard search
you must call dfirst() once to supply the search pattern
and get back the first file that matches that pattern.
then, call dnext() to get the next file in the list.
both dfirst() and dnext() return zero if a file has been found,
non-zero otherwise.
The calling parameters are as follows:
dfirst(pattern,attr,file_name,file_date,file_time,file_size);
dnext(file_name,file_date,file_time,file_size);
Where:
char *pattern; (wild card pattern. eg. "*.c" )
int attr; (the file attribute qualifier )
char *file_name; (output: the name of found file (13 bytes min.) )
int *file_date; (output: the file's date (directory format) )
int *file_time; (output: the file's time )
long *file_size; (output: the file's size in bytes )
*----------------------------------------------------------------- */
#include <dos.h>
#include <stdlib.h>
#define SET_DTA 0x1A
#define GET_DTA 0x2F
#define FIND_FIRST 0x4E
#define FIND_NEXT 0x4F
struct dta_struct {
char dummy[21];
char attr;
int time;
int date;
int low_size;
int hi_size;
char name[13];
char dummy2[14];
};
static struct dta_struct dta;
dfirst (fmask,fattr,fname,fdate,fti
相关文档:
高质量C++/C编程指南
文件状态
[ ] 草稿文件
[√] 正式文件
[ ] 更改正式文件 文件标识:
当前版本: 1.0
作 者: 林锐 博士
完成日期: 2001年7月24日
版 本 历 史
版本/状态 作者 参与者 起止日期 备注
V ......
/***************************************************
* 函数说明: 判断当前path参数是否为一个可读的文件
* 函数返回: 0 - 文件刻度 1 - 权限拒绝 -1 -函数错误
* 参 数 : path 文件路径.
***************************************************/
int isReadFile(const char *path)
{
&nb ......
typedef struct StackNode
{
ElemType data;
StackNode *next;
)StackNode, *LinkType; &nb ......
前言:这一章我们讨论一下Linux下的信号处理函数.
Linux下的信号处理函数:
1.信号的产生
2.信号的处理
3.其它信号函数
--------------------------------------------------------------------------------
一个实例
1。信号的产生 ......