TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:8016] case sensitive cdrom



Here is a dirty one, and you might have to tweak it for this to work the
way you want it to. Access the files from your webserver, put a cgi 
wrapper such as the one for all the files in the virtual path that your
CDROM sits on and the cgi script converts all HREF tags to uppercase.

You can also do this to the IMG tags. I had used it a long time ago,
hope it still works.

--
sandipan

Carl Wilhelm Soderstrom wrote:
> 
> >I have a cdrom that's "designed for win95"--the file names show as
> >lowercase when mounted under a UNIX machine because UNIX is case
> >sensitive.  The problem is the cd contains HTML docs with href's that
> >point at UPPERCASE filenames.  I've been over the mount man page but
> >didn't find a option to mount as UPPERCASE only.  Anyone know any
> >quick & dirty tricks?
>         just kicking out an idea here:
>         could you do something with smbmount? I know SAMBA name-mangling is
> pretty heavily configurable (used it once to change case on a file
> transfer); does smbmount have similar options?
>         I'm sure there's a kludge in there for your situation; but I haven't
> had to  wrestle much with SMB stuff since I set it up. (which is a Good
> Thing; that's why I use Linux. ;> )
> 
> Carl Soderstrom.
> System Administrator    307 Brighton Ave.
> Minnesota DHIA          Buffalo, MN
> carls@agritech.com              (612) 682-1091
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-list-help@mn-linux.org
#!/usr/bin/perl
#Converts all links in the html docs passed to it to uppercase.
print "Content-type: text/html\n\n";

$filename=$ENV{PATH_TRANSLATED};

unless ( open( INP, "< $filename" ) ) {
#Unable to open the file..
   printf( "<html><title>Page not found</title><body>" );
   printf "<H2>Unable to Locate file %s</H2>", $filename;
   printf( "</html></body>" );
   exit;
}

#Opened the file just dunp input to output
while(<INP>) {
  s/HREF="([^"]*)"/"HREF=\"".scalar uc($1)."\""/ie;
  print;
}

close(INP);
exit;