Hi all,
 
I am trying to read a directory and find a file named ZQ3709.ZQ (client win95) but this file appears in the windows directory as Zq3709.zq - apparently this is the windows naming standard - when i run the function below - it will not find this file.
 
 
However if i rename the criteria in my script to look for Zq3709.zq exactly as windows diplays this file  - it will - please help how can i access this file using what i think is the proper name for it. The MSDOS filename would be all capitals can i force it to think the OS uses this naming standard ?
 
Any suggestions would be greatly appreciated.
 
Thanks
Margaret
 
 
 
User hits a link :
 print qq!<TD><font size="2"><a      
      href="dbi_dstran.cgi?searchforfile=True&&
      filename=ZQ$Files&&dir=$formatcolumn">Analyse</a></TD>\n!; # if i use zq$Files this will work ???????
 
 

Filename will now equal ZQ3709
 
Selecting this link calls the getfile function:
 
sub GetFile
{
 # print out header details - explains to browser, display this page is a basic html page for the graphs
 print "HTTP/1.0 200 OK\n";
 print "Content-Type: text/html\n\n\n";
  
 # Opened the data directory and read in the list of files
 opendir(WD,"R:/QUALITY/Data/dsdb/$dir/") || die &printnofiles(); #no files
 
 # problem with this is that its done on fly - read dir find any matches 
 # however need prescan to ensure that file is in directory first
 for (sort(/^$filename/, readdir(WD)))
  {
  if(/^$filename/)
  {
       $filefound = "True";
  }
 }
 closedir(WD) || die "Cannot close directory:  $!\n";
      
 if ($filefound eq "True")
 {
  opendir(WD,"R:/QUALITY/Data/dsdb/$dir/") || die &printnofiles(); #no files
  
  for my $file (sort(grep(/^$filename/,readdir(WD))))
  { 
   # Use below to run across network 
   print qq!<font size="3"><b><A HREF="\"R:\\QUALITY\\Data\\dsdb\\$dir\\$file\">Click" here to Download</A></b><BR>\n!;
   print qq!<font size="2"><B>File Name - $file</B> \n!;
   print qq!<BR>!;
  
   $filesize = stat("R:/QUALITY/Data/dsdb/$dir/$file")->size;
   print qq!<font size="2"><B>Filesize - $filesize bytes </B>\n!;
  }
 }
 else
 {
      &printnofiles(); #no files
  exit;
 }
 
 closedir(WD) || die "Cannot close directory:  $!\n"; 
 
 print qq!
 <HTML>  
 <HEAD>
  </BODY>
 </HTML>!;
 exit;
}
 
 
 
 

Reply via email to