Category : File Managers
Archive   : FHID22.ZIP
Filename : FHID.C
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ FHID.C - Hidden File/Directory Finder v2.2 ³
³ ³
³ written by Mike Smedley ³
³ ³
³ using Turbo C version 1.5 ³
³ ³
³ syntax: FHID [d:] [/S] ³
³ ³
³ When /S is used, all files and directories ³
³ under a hidden directory are considered ³
³ hidden as well. ³
³ ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
*/
#include
getdisk() setdisk() ffblk */
#include
#include
#include
#include
#define NO 0
#define YES 1
#define ARRAY_SIZE 10
#define PATH_SIZE 70
#define SELECT (FA_HIDDEN|FA_SYSTEM|FA_DIREC)
void search_dir(void); /* prototype of recursive function */
/* global variables */
int dir_ptr=0; /* directory array subscript */
int s_switch=NO; /* was /S specified on command line */
int inside_hidden=NO; /* inside hidden directory flag */
int drive_spec=NO; /* was a drive specified on cmd line */
char curr_path[PATH_SIZE]; /* holds current path specification */
struct dir_t {
char path[PATH_SIZE];
int inside_hidden;
} dir[ARRAY_SIZE]; /* array which hold nested paths */
void main(int argc,char *argv[])
{
register int i;
char drive,*p;
char old_path[PATH_SIZE];
/* display title to the stdout */
printf("\nHidden File/Directory Finder v2.2\n");
printf(" by Mike Smedley 5/31/88\n\n");
/* scan command line for a drive specification or /S switch.
If a drive is specified, change drive over to it. */
for(i=1;i
p=argv[i];
if(*(p+1)==':') {
drive_spec=YES;
drive=getdisk();
setdisk(*(p)-65);
}
if(*p=='-'||*p=='/') {
if(*(p+1)=='S') s_switch=YES;
}
if(*p=='?') {
printf("Syntax: FHID [d:] [/S]\n");
exit(0);
}
}
/* save current path specification */
*(old_path)='\\';
getcurdir(0,old_path+1);
/* initialize current path variable to root directory */
*(curr_path)='\\';
*(curr_path+1)='\0';
/* start the recursive search function */
search_dir();
/* change directory back to original path */
chdir(old_path);
/* if drive was specified, change back to original drive */
if(drive_spec) setdisk(drive);
/* exit program with ERRORLEVEL = 0 */
exit(0);
}
void search_dir(void)
{
int done=NO,hidden;
struct ffblk ffblk;
/* change directory to contents of curr_path */
chdir(curr_path);
/* find first matching directory or hidden file */
done=findfirst("*.*",&ffblk,SELECT);
while(!done) {
/* determine if found file/directory is hidden, or, if
/S was specified, under a hidden directory */
hidden=(ffblk.ff_attrib&FA_HIDDEN)|(ffblk.ff_attrib&FA_SYSTEM)|
inside_hidden;
/* if file/directory is hidden, display it to the stdout */
if(hidden) {
if(ffblk.ff_attrib&FA_DIREC) {
if(!strstr(ffblk.ff_name,".")) {
printf("Directory: %s%s%s\n",curr_path,
*(curr_path+1)==0?"":"\\",ffblk.ff_name);
}
}
else {
printf("File: %s%s%s\n",curr_path,
*(curr_path+1)==0?"":"\\",ffblk.ff_name);
}
}
/* if file is a directory, save current info and change dir to it.
Then call the search_dir() function. Upon return, the old
info will be restored and the directory will be changed back
and the search will pick up where it left off. */
if(ffblk.ff_attrib&FA_DIREC) {
if(!strstr(ffblk.ff_name,".")) {
strcpy(dir[dir_ptr].path,curr_path);
dir[dir_ptr].inside_hidden=inside_hidden;
if(hidden&&s_switch) inside_hidden=YES;
dir_ptr++;
chdir(ffblk.ff_name);
getcurdir(0,curr_path+1);
search_dir();
dir_ptr--;
strcpy(curr_path,dir[dir_ptr].path);
inside_hidden=dir[dir_ptr].inside_hidden;
chdir(curr_path);
}
}
/* find next eligible entry inside current directory */
done=findnext(&ffblk);
}
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/