Category : Files from Magazines
Archive   : CUJ9306.ZIP
Filename : 1106133A

 
Output of file : 1106133A contained in archive : CUJ9306.ZIP
/* findfile.c: Search all directories for a file */

#include
#include
#include
#include
#include
#include
#include
#include
#include

/* Change these for UNIX */
#define SEPSTR "\\"
#define OFFSET 2

void visit_dirs(char *dir, char *file);

main(int argc, char *argv[])
{
if (argc > 1)
{
char *file = argv[1];
char *root = (argc > 2) ? argv[2] : SEPSTR;

visit_dirs(root,file);
}
return 0;
}

void visit_dirs(char *dir, char *file)
{
DIR *dirp;
struct dirent *entry;
struct stat finfo;
char *curdir = getcwd(NULL,FILENAME_MAX);

/* Enter the directory */
assert(chdir(dir) == 0);

/* Process current directory */
if (access(file,0) == 0)
{
char *tempdir = getcwd(NULL,FILENAME_MAX);
char *sep = strcmp(tempdir+OFFSET,SEPSTR) ?
SEPSTR : "";
printf("%s%s%s\n",
strlwr(tempdir+OFFSET),sep,strlwr(file));
free(tempdir);
}

/* Descend into subdirectories */
assert((dirp = opendir(".")) != NULL);
while ((entry = readdir(dirp)) != NULL)
{
if (entry->d_name[0] == '.')
continue;
stat(entry->d_name,&finfo);
if (finfo.st_mode & S_IFDIR)
visit_dirs(entry->d_name,file);
}

/* Cleanup */
closedir(dirp);
chdir(curdir+OFFSET);
free(curdir);
}




  3 Responses to “Category : Files from Magazines
Archive   : CUJ9306.ZIP
Filename : 1106133A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/