C语言:求头文件dir.h

这个头文件主要包涵了findfirst, findnext这两个函数,其具体作用分别是搜索磁盘目录; 取得下一个匹配的findfirst模式的文件,用法如int findfirst(char *pathname, struct ffblk *ffblk, int attrib)//int findnext(struct ffblk *ffblk);当然在这里还得定义一个ffblk结构体,用来存放目录文件的一些信息,详细解说可以上百度百科了解!有哪位有这个dir.h头文件的请转发一下,或直接放在答案里面。谢谢

TC2.0
/* dir.h
Defines structures, macros, and functions for dealing with
directories and pathnames.
Copyright (c) Borland International 1987,1988
All Rights Reserved.
*/
#if __STDC__
#define _Cdecl
#else
#define _Cdecl cdecl
#endif
#if !defined(__DIR_DEF_)
#define __DIR_DEF_
struct ffblk {
char ff_reserved[21];
char ff_attrib;
unsigned ff_ftime;
unsigned ff_fdate;
long ff_fsize;
char ff_name[13];
};
#define WILDCARDS 0x01
#define EXTENSION 0x02
#define FILENAME 0x04
#define DIRECTORY 0x08
#define DRIVE 0x10
#define MAXPATH 80
#define MAXDRIVE 3
#define MAXDIR 66
#define MAXFILE 9
#define MAXEXT 5
int _Cdecl chdir (const char *path);
int _Cdecl findfirst (const char *path, struct ffblk *ffblk,
int attrib);
int _Cdecl findnext (struct ffblk *ffblk);
void _Cdecl fnmerge (char *path,const char *drive,const char *dir,
const char *name, const char *ext);
int _Cdecl fnsplit (const char *path, char *drive, char *dir,
char *name, char *ext);
int _Cdecl getcurdir (int drive, char *directory);
char *_Cdecl getcwd (char *buf, int buflen);
int _Cdecl getdisk (void);
int _Cdecl mkdir (const char *path);
char *_Cdecl mktemp (char *template);
int _Cdecl rmdir (const char *path);
char *_Cdecl searchpath (const char *file);
int _Cdecl setdisk (int drive);
#endif

BC3.1
/* dir.h
Defines structures, macros, and functions for dealing with
directories and pathnames.
Copyright (c) 1987, 1992 by Borland International
All Rights Reserved.
*/
#if !defined(__DIR_H)
#define __DIR_H
#if !defined(___DEFS_H)
#include <_defs.h>
#endif
#ifndef _FFBLK_DEF
#define _FFBLK_DEF
struct ffblk {
char ff_reserved[21];
char ff_attrib;
unsigned ff_ftime;
unsigned ff_fdate;
long ff_fsize;
char ff_name[13];
};
#endif
#define WILDCARDS 0x01
#define EXTENSION 0x02
#define FILENAME 0x04
#define DIRECTORY 0x08
#define DRIVE 0x10
#define MAXPATH 80
#define MAXDRIVE 3
#define MAXDIR 66
#define MAXFILE 9
#define MAXEXT 5
#ifdef __cplusplus
extern "C" {
#endif
int _CType chdir( const char _FAR *__path );
int _CType _FARFUNC findfirst( const char _FAR *__path,
struct ffblk _FAR *__ffblk,
int __attrib );
int _CType _FARFUNC findnext( struct ffblk _FAR *__ffblk );
void _CType _FARFUNC fnmerge( char _FAR *__path,
const char _FAR *__drive,
const char _FAR *__dir,
const char _FAR *__name,
const char _FAR *__ext );
int _CType _FARFUNC _fnsplit(const char _FAR *__path,
char _FAR *__drive,
char _FAR *__dir,
char _FAR *__name,
char _FAR *__ext );
int _CType _FARFUNC fnsplit( const char _FAR *__path,
char _FAR *__drive,
char _FAR *__dir,
char _FAR *__name,
char _FAR *__ext );
int _Cdecl getcurdir( int __drive, char _FAR *__directory );
char _FAR * _Cdecl _FARFUNC getcwd( char _FAR *__buf, int __buflen );
int _Cdecl getdisk( void );
int _Cdecl mkdir( const char _FAR *__path );
char _FAR * _Cdecl _FARFUNC mktemp( char _FAR *__template );
int _Cdecl rmdir( const char _FAR *__path );
char _FAR * _CType _FARFUNC searchpath( const char _FAR *__file );
int _Cdecl setdisk( int __drive );
#ifdef __cplusplus
}
#endif
#endif /* __DIR_H */
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-07-01
编译器里应该有这个文件。
/* dir.h
Defines structures, macros, and functions for dealing with
directories and pathnames.
*/
/*
* C/C++ Run Time Library - Version 11.0
*
* Copyright (c) 1987, 2002 by Borland Software Corporation
* All Rights Reserved.
*
*/
/* $Revision: 9.12.2.2 $ */
#if !defined(__DIR_H)
#define __DIR_H
#include <_stddef.h>
#if !defined(___TCHAR_H)
#include <tchar.h>
#endif
#if !defined(RC_INVOKED)
#if defined(__STDC__)
#pragma warn -nak
#endif
#endif /* !RC_INVOKED */
#ifdef __cplusplus
namespace std {
#endif /* __cplusplus */
#define WILDCARDS 0x01
#define EXTENSION 0x02
#define FILENAME 0x04
#define DIRECTORY 0x08
#define DRIVE 0x10

#if !defined(RC_INVOKED)
#pragma pack(push, 1)
#endif
#ifndef MAXPATH
#define MAXPATH 260
#define MAXDIR 256
#define MAXFILE 256
#define MAXEXT 256
#define MAXDRIVE 3
#endif
#ifndef _FFBLK_DEF
#define _FFBLK_DEF
struct ffblk {
long ff_reserved;
long ff_fsize;
unsigned long ff_attrib;
unsigned short ff_ftime;
unsigned short ff_fdate;
char ff_name[MAXPATH];
};
struct _wffblk {
long ff_reserved;
long ff_fsize;
unsigned long ff_attrib;
unsigned short ff_ftime;
unsigned short ff_fdate;
wchar_t ff_name[MAXPATH];
};
#endif
#ifndef FA_NORMAL
#define FA_NORMAL 0x00 /* Normal file, no attributes */
#define FA_RDONLY 0x01 /* Read only attribute */
#define FA_HIDDEN 0x02 /* Hidden file */
#define FA_SYSTEM 0x04 /* System file */
#define FA_LABEL 0x08 /* Volume label */
#define FA_DIREC 0x10 /* Directory */
#define FA_ARCH 0x20 /* Archive */
#endif /* FA_NORMAL */
#ifndef _A_NORMAL
/* MSC names for file attributes */
#define _A_NORMAL 0x00 /* Normal file, no attributes */
#define _A_RDONLY 0x01 /* Read only attribute */
#define _A_HIDDEN 0x02 /* Hidden file */
#define _A_SYSTEM 0x04 /* System file */
#define _A_VOLID 0x08 /* Volume label */
#define _A_SUBDIR 0x10 /* Directory */
#define _A_ARCH 0x20 /* Archive */
#endif /* _A_NORMAL */
#define _getcwd(a,b) getcwd(a,b)
#if !defined(RC_INVOKED)
#pragma pack(pop) /* restore default packing */
#endif
#ifdef __cplusplus
extern "C" {
#endif
int _RTLENTRYF _EXPFUNC32 chdir( const char _FAR *__path );
int _RTLENTRYF _EXPFUNC findfirst( const char _FAR *__path,
struct ffblk _FAR *__ffblk,
int __attrib );
int _RTLENTRYF _EXPFUNC findnext( struct ffblk _FAR *__ffblk );
int _RTLENTRYF _EXPFUNC findclose( struct ffblk _FAR *__ffblk );
void _RTLENTRYF _EXPFUNC fnmerge( char _FAR *__path,
const char _FAR *__drive,
const char _FAR *__dir,
const char _FAR *__name,
const char _FAR *__ext );
int _RTLENTRYF _EXPFUNC fnsplit(const char _FAR *__path,
char _FAR *__drive,
char _FAR *__dir,
char _FAR *__name,
char _FAR *__ext );
int _RTLENTRY _EXPFUNC32 getcurdir( int __drive, char _FAR *__directory );
char _FAR * _RTLENTRY _EXPFUNC getcwd( char _FAR *__buf, int __buflen );
int _RTLENTRY _EXPFUNC32 getdisk( void );
int _RTLENTRY _EXPFUNC32 _mkdir( const char *__path );
char * _RTLENTRY _EXPFUNC _mktemp( char *__template );
int _RTLENTRY _EXPFUNC32 _rmdir( const char _FAR *__path );
char _FAR * _RTLENTRYF _EXPFUNC32 searchpath( const char _FAR *__file );
int _RTLENTRY _EXPFUNC32 setdisk( int __drive );
#if !defined(__STDC__)
int _RTLENTRY _EXPFUNC32 mkdir( const char *__path );
char * _RTLENTRY _EXPFUNC mktemp( char *__template );
int _RTLENTRY _EXPFUNC32 rmdir( const char *__path );
#endif
int _RTLENTRY _EXPFUNC32 _wchdir( const wchar_t *__path );
int _RTLENTRY _EXPFUNC32 _wmkdir( const wchar_t *__path );
int _RTLENTRY _EXPFUNC32 _wrmdir( const wchar_t *__path );
wchar_t * _RTLENTRY _EXPFUNC32 wsearchpath( const wchar_t *__file );
wchar_t * _RTLENTRY _EXPFUNC _wmktemp( wchar_t *__template );
int _RTLENTRY _EXPFUNC _wfindfirst( const wchar_t *__path,
struct _wffblk *__ffblk,
int __attrib );
int _RTLENTRY _EXPFUNC _wfindnext( struct _wffblk *__ffblk );
int _RTLENTRY _EXPFUNC _wfindclose( struct _wffblk *__ffblk );
int _RTLENTRY _EXPFUNC _wfnsplit(const wchar_t *__path,
wchar_t *__drive,
wchar_t *__dir,
wchar_t *__name,
wchar_t *__ext );
void _RTLENTRY _EXPFUNC _wfnmerge( wchar_t *__path,
const wchar_t *__drive,
const wchar_t *__dir,
const wchar_t *__name,
const wchar_t *__ext );
wchar_t * _RTLENTRY _EXPFUNC _wgetcwd( wchar_t *__buf, int __buflen );
int _RTLENTRY _EXPFUNC _wgetcurdir( int __drive, wchar_t *__directory );
#ifdef __cplusplus
}
#endif

#if !defined(RC_INVOKED)
#if defined(__STDC__)
#pragma warn .nak
#endif
#endif /* !RC_INVOKED */
#ifdef __cplusplus
} // std
#endif /* __cplusplus */
#endif /* __DIR_H */
#if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__DIR_H_USING_LIST)
#define __DIR_H_USING_LIST
using std::ffblk;
using std::_wffblk;
using std::chdir;
using std::findfirst;
using std::findnext;
using std::findclose;
using std::fnmerge;
using std::fnsplit;
using std::getcurdir;
using std::getcwd;
using std::getdisk;
using std::_mkdir;
using std::_mktemp;
using std::_rmdir;
using std::searchpath;
using std::setdisk;
#if !defined(__STDC__)
using std::mkdir;
using std::mktemp;
using std::rmdir;
#endif
using std::_wchdir;
using std::_wmkdir;
using std::_wrmdir;
using std::wsearchpath;
using std::_wmktemp;
using std::_wfindfirst;
using std::_wfindnext;
using std::_wfindclose;
using std::_wfnsplit;
using std::_wfnmerge;
using std::_wgetcwd;
using std::_wgetcurdir;
#endif /* __USING_CNAME__ */本回答被网友采纳
相似回答