473,803 Members | 4,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Find::File error: Invalid Top Directory

53 New Member
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:
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. #
  3. use strict;
  4. use warnings;
  5. use File::Find;
  6. use MSDOS::Attrib qw(get_attribs set_attribs);
  7.  
  8. (my $sec, my $min, my $hour, my $mday, my $mon, my $year, my $wday, my $yday, my $isdst)=localtime(time);
  9. $year = $year + 1900;           # $year 0 = real year 1900
  10. $mon = $mon + 1;                # $month 0 = January
  11.  
  12. open(LOG, ">>./atd_files_$year-$mon-$mday\.txt")  or die "Can't open LOG: $!";
  13. print LOG ("\n*****************************************      NEW LAUNCH      *****************************************\n") or die "Can't write to LOG: $!";;
  14. 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: $!";
  15.  
  16. my $homedir = "E:/test_dir";
  17. opendir (IMD, $homedir) or die "Couldn't find dir: IMD ($!)";
  18. my @thefiles= readdir(IMD);
  19. closedir(IMD);
  20.  
  21. my @dirs;
  22. my $x=0;
  23. my $n = 0;
  24.  
  25. foreach my $f (@thefiles){
  26.         if (-d $f && $f !~ /^\.+/){
  27.                 print "$f\n";
  28.                 $dirs[$x]=$f;
  29.                 $x++;
  30.         }
  31. }
  32.  
  33. #print "@dirs\n";
  34. find(\&wanted,  @dirs);
  35.  
  36. sub wanted {
  37.         if (/Project\.atd/){
  38.                 my $attrib = get_attribs($File::Find::name);    
  39.                 if ( $attrib =~ /.H.+/){            
  40.                         $n++;
  41.                         print "$File::Find::name\n";
  42.                 }
  43.         }
  44. }
  45.  
  46. print ("\n\nTotal: $n files\n");
  47.  
  48. print ("\a");
  49. ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime(time);
  50. 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: $!";
  51. print LOG ("\n*****************************************      END LAUNCH      *****************************************\n") or die "Can't write to LOG: $!";
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!!
Nov 16 '09
11 7433
RonB
589 Recognized Expert Moderator Contributor
Filehandles that use a lexical var instead of a bareword will automatically close when they go out of scope. However, it is best practice to explicitly close them when they are no longer needed.
Nov 19 '09 #11
ezechiel
53 New Member
ok,
thanks for all this precious info Ron ;)
It helped me a lot!
Nov 20 '09 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2635
by: Joe Hershman | last post by:
all, not sure what the best place to post this one, hopefully someone can help because this is a real show stopper. i am getting the error shown below when i try to build a deployment project. all the projects build fine, but when vs.net starts to create the msi the error occurs. i am seeing this same (the file sometimes differs) error on two different machines so i don't think it is related to the computer. i have uninstalled...
3
3968
by: Brian Fulford | last post by:
I am trying to deploy a web app with a deployment project since I am including Crystal Reports for .Net. I attached all the merge modules, etc but I am getting a build error when I try to build the setup project. Could not find file 'C;\Web\ccsm\ccsm_search.aspx' 'Interface not registered' Thie file is included in the project, so I am not sure what is going on!!
2
3011
by: jlacefie | last post by:
Hello, I am having trouble with the following code using ASP.Net 2.0. I recieve an error on the line File.OpenRead(fPath) stating could not find file . The fPath comes from a textbox control on the client and the error displays the correct path for the file. This code works when I use the browser on the server that is hosting the site, but it does not work when I access this site on any other machine. Does the OpenRead only work on...
1
2450
by: dereski | last post by:
Hey all, I am trying to connect to my database but I am getting error "80004005 Could Not Find File" Any Ideas as to why? I tried recreating the database again, just in case it was corrupted but same result. I am using VBA Set MyConn = New ADODB.Connection MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=N:\new parcel\WawaDogs;" 'Open the connection MyConn.Open
3
3712
by: Amritha.Datta | last post by:
Can anyone tell me why the below code returns error? Exception Details: System.IO.FileNotFoundException: Could not find file Dim strLFolder As String = "c:\Temp\F Files" Dim intClientID As Integer = 1221 Dim XMLStr As String = strLFolder & "\" & intClientID.ToString.Trim & "\Lk\HeaderTrailerDeltails_data.xml" Dim dsPubs As New DataSet
2
7954
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer. When someone else uses the web app and tries to open a file using the remote server the error below happens. any help? **Code** C# - filepath is a valid file name which is passed via the form. System.IO.BinaryReader br = new...
0
1497
by: chandan | last post by:
Hi All, I am creating a web setup Project using VS 2005.First time its works fine, But when I closed the solution and again open solution and try to build web setup project then there is an error like that could not find file (.msi,.exe,.tmp) with these extension inside the debug or release folder of the web setup Project. I am not able to find where is the problem, some times its works and sometime raises error for cannot find file....
6
4934
by: =?Utf-8?B?U2NvdHQgVHJpY2s=?= | last post by:
I followed the instructions from MSDN for Webclient UploadFile and I get an error: Could not find file 'C:\testfile.xls'. If I add the file (c:\testfile.xls) to the server I do not get the error and the file is copied from the server to the server, rather than from the web client to the server. Please help!!!
6
4382
JustRun
by: JustRun | last post by:
I have two windows application projects in the same solution, The solution contains an application that has a reference to another application in the same solution, When I tried to publish the project that contains the reference it gave me that error : Error 8 :Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0 And another question: If I will use the project 1 with all my project is it correct to make...
0
1733
JustRun
by: JustRun | last post by:
Hi All This is a very urget, Plz answer me I have two windows application projects in the same solution, The solution contains an application that has a reference to another application in the same solution, When I tried to publish the project that contains the reference it gave me that error : Error 8 :Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10548
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.