SourceForge has been redesigned. Learn more.

#52 opendir doesn't work?


I have downloaded & installed the latest lxr version.

I have
always preferred python, php or csh-gawk-grep-sed to do scripting
over perl, so i will need your help here :)

My problem is
that when i point my browser to http://localhost/lxr/source
get a message that my src directory can't be read (although it is
So even though i get the header stuff of the page, etc i
don't get the contents
of the src dir in the browser.

Error is
in : lib/LXR/File/ line 104

So what can the problem be?
I know that somehow apache must have access to that
directory. I
put a link from /usr/local/lxr to my source dir, so that permissions
.htacess apply to src dir too, but i still can't have access to
the src dir !!!
How can i solve this ??

Now, i tried to debug, by printing some stuff, but the fact is i keep
the error for line 104 again, although it is now 107! I have diabled

caching in the browser, so i guess it is apache who has cached the
How can i solve this too??

Many thanks !



  • Robbie Ye

    Robbie Ye - 2002-04-28

    Logged In: YES


    I have an error reported at the same file, same line number,
    i.e. line 104. The complete error message is like this:

    ** Fatal: Can't open
    /home/robbieye/indexed-src/GEANT4/4.0/source/digits hits/ at
    /home/robbieye/lxr-0.9.1//lib/LXR/Files/ line 104.

    I am using LXR 0.9.1 to cross reference Geant4 4.0 package.
    Every directory in the source tree is cross referenced and
    browsable except for this particular one with a '+' in the
    directory name: "digits+hits". So apparently the perl
    scripts changed the '+' to ' ' and so the opendir() fails

    Now let me explain my story more precisely. So, most of the
    things work fine, except for the following case.

    When I browse the parent directory of "digits+hits", which is:
    On the shown page, there is a link to the sub directory
    "digits+hits", the link is shown correctly

    Then when I clicked on this link, the returned URL in the
    browser's (i'm using Opera) address bar is:
    So this is still correct. But the return page itself
    contains the error message:
    ** Fatal: Can't open
    /home/robbieye/indexed-src/GEANT4/4.0/source/digits hits/ at
    /home/robbieye/lxr-0.9.1//lib/LXR/Files/ line 104.

    Also, the directory title in the page is showed as "GEANT4/
    source/ digits hits/", so the '+' is substituted by a blank
    space somehow. And when I move my browser to the "digits
    hits" portion of this erroroneous link, it reads:
    so the "%2B" is changed to "%20" in the address.

    I knew little about Perl to fix the problem myself, can
    someone out there help me with this? Thank you very much,
    I'd be more than happy to verify your solutions! Actually i
    tried to look into the Perl scripts, and I stop at the
    function http_wash in file /lib/LXR/ and comment
    out the line: "$t =~ s/\+/ /g;", but the error is still
    there(i didn't restart my browser though).

    Robbie <>

  • Malcolm Box

    Malcolm Box - 2002-04-30

    Logged In: YES

    The problem is in http_wash in This function is
    quite aggressive in cleaning "special" characters out of
    input values, to prevent security attacks.

    I haven't done a full security check to see whether this
    could be relaxed somewhat, but if you're not so concerned
    about security the easiest thing to do is to remove the call
    to http_wash:

    $HTTP->{'path_info'} = http_wash($ENV{'PATH_INFO'});

    in the httpinit function in

  • Robbie Ye

    Robbie Ye - 2002-05-01

    Logged In: YES

    Yes, both ways worked, so either of these two:

    1) Remove the http_wash() call and do a direct assignment in
    $HTTP->{'path_info'} = http_wash($ENV{'PATH_INFO'});
    $HTTP->{'path_info'} = $ENV{'PATH_INFO'};

    2) Comment out "$t =~ s/\+/ /g;", the 5th line in
    http_wash() function.
    Last time I forgot to hit refresh button after changing
    the so what i saw is the cached page.

    Thanks a lot!

  • Malcolm Box

    Malcolm Box - 2002-05-09
    • status: open --> closed-accepted

Log in to post a comment.