home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
bbs
/
dlp100.zip
/
FA.C
next >
Wrap
C/C++ Source or Header
|
1993-06-23
|
910b
|
38 lines
#include <stdio.h>
#include <stdlib.h>
#include "ra.h"
main()
{
char Path[128];
char WorkName[41];
char WorkPath[41];
char Line[80];
unsigned int FileNum=0;
int i, j;
struct FILES FileRec;
RAEnvr = getenv("RA");
strcpy (Path, RAEnvr);
strcat (Path, "\\FILES.RA");
if((FILES_RA=fopen(Path,"rb"))==NULL)
{ printf("\n\nUnable to open %s!\n", Path);
getch();
return(1);
}
fprintf (stdout, " %s %-35s %s\n\n", "File ", "Name", "Path");
while(fread(&FileRec, sizeof(FileRec), 1, FILES_RA)==1)
{ FileNum++;
if(FileRec.NameSize)
{ strncpy (WorkName, FileRec.Name, FileRec.NameSize);
WorkName[FileRec.NameSize]='\0';
strncpy (WorkPath, FileRec.FilePath, FileRec.FilePathSize);
WorkPath[FileRec.FilePathSize]='\0';
fprintf(stdout, "%5u\) %-35s %-35s\n", FileNum, WorkName, WorkPath);
}
}
fclose(FILES_RA);
}