Category : Files from Magazines
Archive   : PCTJ8805.ZIP
Filename : PATHNAME.C
*
* Extracts the path portion, up to & including the rightmost
* backslash, from a fully qualified filename.
* Returns length of pathname string.
*
*/
int pathname( char *fname, char *path)
{
int x, len;
len = strlen(fname);
while (len && fname[len-1] != '\\') --len;
for (x=0; x
path[x] = 0;
return (x);
}
main() /* demo driver for pathname & progname functions*/
{
int len1, len2;
char filestr[80];
char pathstr[80];
len1 = progname(filestr);
len2 = pathname(filestr, pathstr);
printf("Full name is %s, length %d\n", filestr, len1);
printf("Path name is %s, length %d\n", pathstr, len2);
}
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/