Invalid top directory at d:\perl\lib\file\find.pm line 562



Hi, i am using the following script to find a file entered by a user.

use Win32::DriveInfo;
use File::Find;

my @drives = Win32::DriveInfo::DrivesInUse(); #Get the drives on a
Machine

my $cnt=@drives; #Number of Drives

my $i=$cnt; #Counter assignment

#The following loop appends "/" to the drive letter
#if the drive is a fixed drive.

for($i;$i>0;$i--)
{
$type=Win32::DriveInfo::DriveType($drives[$i-1]);
if($type==3)#fixed drives
{
$d[$i-1]=$drives[$i-1].":"."\\","\\";
}
}

$temp=$ARGV[0]; #store filename to be found

my @t=split(/\./,$temp); #Split the filename to get the extension

my $cnt=@t;

$f=".".$t[$cnt-1]; #Append "." and extension

find(\&cleanup,@d); #standard file find function

sub cleanup {

if ((/$f/))#$f= appneding "." and file extension for eg:
$f=.pl,$f=.txt
{
$path=$File::Find::name; #$path will contain the complete
path of a file

@p=split(/\//,$path); #just get the file name

$cnt=@p;
if($p[$cnt-1] eq $temp)
{
print "\n File Found",$path;
}



}

}


If i run this script i am getting the error as "Invalid top directory
at d:\perl\lib\file\find.pm line 562, <DATA> line164"

Pls help me.


Thanks in advances :)

.



Relevant Pages

  • Re: Script initiate a drive connection?
    ... Network & Software Integration ... Dim objWMI, objPing, colPings, ServerOnline, Result ... in a script the double click on a disconnected drive. ... automatically connect map drives on boot up.) ...
    (microsoft.public.windows.server.scripting)
  • Re: Script initiate a drive connection?
    ... I tried this script and received an error "The NTVDM CPU has ... Dim objWMI, objPing, colPings, ServerOnline, Result ... Network & Software Integration ... automatically connect map drives on boot up.) ...
    (microsoft.public.windows.server.scripting)
  • Re: ubuntu-users Digest, Vol 54, Issue 174
    ... For a specific usb drive I instead want a script to run (to run ... folks: random vnc attempts ... the security updates to get into the system to fiddle with rootkits. ...
    (Ubuntu)
  • Re: mapped drives and desktop shortcut all a group of users
    ... I added the logon script in the user config area of the default domain GPO ... I updated group policy on the DC and the workstation I was working on ... As mapped drives are generally profile specific, ...
    (microsoft.public.windows.server.active_directory)
  • Re: Script initiate a drive connection?
    ... That worked without having to run the script. ... Network & Software Integration ... Dim objWMI, objPing, colPings, ServerOnline, Result ... automatically connect map drives on boot up.) ...
    (microsoft.public.windows.server.scripting)