Post by Andreas Kohl<ftp://cyberia.dnsalias.com/pub/filebase/gfd/sys/tool/PMCHKLOG.ZIP>
Yes, now it works because the filenames are uppercased too. Earlier
the HTML link was uppercased, but the filename was still the original
lowercase one, so I had to use FTP to (find that out and) download
"pmckhlog.zip" instead of "PMCHKDSK.LOG".
Post by Andreas KohlPost by Harald Kammhttp://cyberia.dnsalias.com/Gfd.Sys.Tool01.Htm
Works fine too. With FTP I did notice the use of mixed case, so
lowercasing all filenames wouldn't have worked. If the files are
stored locally (i.e. you know the real, original name), then e.g. a
Rexx script (SysFileTree() -> DosFindFirst() API) can be used to
repair the HTML links. Like:
<A HREF="ftp://ftp.mixedca.se/FileTree.ZIP">Download FILETREE.ZIP
now!</A>
Thread-drift: an OS command like "CD" will return what you typed.
Like:
MD Test
CD test
CD
CD ..
CD TEST
CD
CD ..
RD Test
You'd have to use code like this to show the real, original case:
#define INCL_DOSFILEMGR
#include <direct.h>
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[])
{
APIRET rc;
char *buffer,buffer2[CCHMAXPATH],path[CCHMAXPATH],path2[CCHMAXPATH];
FILEFINDBUF3 filebuf={0};
HDIR hdir=HDIR_SYSTEM;
int drive=0,length,position;
ULONG filebuflen=sizeof(FILEFINDBUF3),searchlimit=1;
if (argc>2)
{
printf("Usage: CD2.EXE [optional, drive, e.g. C:]\n");
return 1;
}
if (argc==2)
{
if (strlen(argv[1])!=2)
{
printf("Usage: CD2.EXE [optional, drive, e.g. C:]\n");
return 1;
}
if (argv[1][0]>'Z')
argv[1][0]-=32;
if (argv[1][0]<'A'||argv[1][0]>'Z'||argv[1][1]!=':')
{
printf("Usage: CD2.EXE [optional, drive, e.g. C:]\n");
return 1;
}
drive=(int)(argv[1][0])-64;
}
if (drive)
buffer=_getdcwd(drive,buffer2,CCHMAXPATH);
else
buffer=_getcwd(buffer2,CCHMAXPATH);
if (NULL==buffer)
{
fprintf(stderr,"SYS0021: the drive is not ready.\n");
return 1;
}
if (strlen(buffer)>3)
{
while (strlen(buffer)>3)
{
rc=DosFindFirst(buffer,
&hdir,
FILE_DIRECTORY,
&filebuf,
filebuflen,
&searchlimit,
FIL_STANDARD);
if (rc)
{
fprintf(stderr,"DosFindFirst() error: rc=%u\n",rc);
return 1;
}
length=strlen(buffer);
position=length;
while (buffer[position]!='\\'&&position>3)
--position;
buffer[position]='\0';
if (strlen(path))
sprintf(path2,"%s\\%s",filebuf.achName,path);
else
sprintf(path2,"%s",filebuf.achName);
sprintf(path,"%s",path2);
rc=DosFindClose(hdir);
if (rc)
{
fprintf(stderr,"DosFindClose() error: rc=%u\n",rc);
return 1;
}
}
strcat(buffer,path);
}
if (strlen(buffer)<3)
{
fprintf(stderr,
"Error: unexpected number of characters (%u) in %s\n",
strlen(buffer),
buffer);
return 1;
}
printf("%s\n",buffer);
return 0;
}
[C:\]cd MAIN
[C:\MAIN]cd tain
[C:\MAIN\tain]cd CASE
[C:\MAIN\tain\CASE]cd
C:\MAIN\tain\CASE
[C:\MAIN\tain\CASE]cd2.exe
C:\Main\Tain\Case
--