hi, I have the following error on a win server:
"Invalid Top Directory perl/lib/file/find.pm line 598
Here's the code and I'll explain what I found until now:
So, the problem is the $homedir
If I put "c:/blabla/blibli" as homedir, everything's ok.
I tested the same script on a 2000pro with "c:/balbla" and "d:/blabla" everything's ok.
But as soon as I put "E:/blabla" on the server, I got the error. Tested with different directories on E:, everytime I got an error. Not on C: or D:
anyone got an idea? (is it a bad thing to edit with Windows Notepad?? I usually use Jext)
Additional info:
I also got the error with
C:/ ; C:/ADMIN but not with C:/ADMIN/Analyst_Project atd_RightsHidde n
I'm totally lost now!!
"Invalid Top Directory perl/lib/file/find.pm line 598
Here's the code and I'll explain what I found until now:
Code:
#!/usr/bin/perl # use strict; use warnings; use File::Find; use MSDOS::Attrib qw(get_attribs set_attribs); (my $sec, my $min, my $hour, my $mday, my $mon, my $year, my $wday, my $yday, my $isdst)=localtime(time); $year = $year + 1900; # $year 0 = real year 1900 $mon = $mon + 1; # $month 0 = January open(LOG, ">>./atd_files_$year-$mon-$mday\.txt") or die "Can't open LOG: $!"; print LOG ("\n***************************************** NEW LAUNCH *****************************************\n") or die "Can't write to LOG: $!";; printf LOG " Script started at:\n %4d-%02d-%02d %02d:%02d:%02d\n\n", $year,$mon,$mday,$hour,$min,$sec or die "Can't write to LOG: $!"; my $homedir = "E:/test_dir"; opendir (IMD, $homedir) or die "Couldn't find dir: IMD ($!)"; my @thefiles= readdir(IMD); closedir(IMD); my @dirs; my $x=0; my $n = 0; foreach my $f (@thefiles){ if (-d $f && $f !~ /^\.+/){ print "$f\n"; $dirs[$x]=$f; $x++; } } #print "@dirs\n"; find(\&wanted, @dirs); sub wanted { if (/Project\.atd/){ my $attrib = get_attribs($File::Find::name); if ( $attrib =~ /.H.+/){ $n++; print "$File::Find::name\n"; } } } print ("\n\nTotal: $n files\n"); print ("\a"); ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime(time); printf LOG "\n\n Script ended at:\n %4d-%02d-%02d %02d:%02d:%02d\n", $year+1900,$mon+1,$mday,$hour,$min,$sec or die "Can't write to LOG: $!"; print LOG ("\n***************************************** END LAUNCH *****************************************\n") or die "Can't write to LOG: $!";
If I put "c:/blabla/blibli" as homedir, everything's ok.
I tested the same script on a 2000pro with "c:/balbla" and "d:/blabla" everything's ok.
But as soon as I put "E:/blabla" on the server, I got the error. Tested with different directories on E:, everytime I got an error. Not on C: or D:
anyone got an idea? (is it a bad thing to edit with Windows Notepad?? I usually use Jext)
Additional info:
I also got the error with
C:/ ; C:/ADMIN but not with C:/ADMIN/Analyst_Project atd_RightsHidde n
I'm totally lost now!!
Comment