is_dir problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bart

    is_dir problem

    i run 4.3.4

    but is_dir doesn't work always.

    when i put a counter in a readdir loop, it returns the number 5

    that is;

    ..
    ...
    test1
    test2
    test3

    those are testdirectorys, but when i do a is_dir on the test directory it
    doesn't return true!

    is this just a bug in 4.3.4 ?

    do i need to compile a new version or is there another directory check
    function?

    bart


  • Pedro Graca

    #2
    Re: is_dir problem

    bart wrote:[color=blue]
    > ... when i do a is_dir on the test directory it
    > doesn't return true!
    >
    > is this just a bug in 4.3.4 ?[/color]

    I'm also using PHP 4.3.4 and is_dir() works fine here.
    Maybe the bug is in your code?
    --
    USENET would be a better place if everybody read: ** mail address **
    http://www.catb.org/~esr/faqs/smart-questions.html ** is valid for **
    http://www.netmeister.org/news/learn2quote2.html ** "text/plain" **
    http://www.expita.com/nomime.html ** to 10K bytes **

    Comment

    • Andy Hassall

      #3
      Re: is_dir problem

      On Sun, 14 Mar 2004 23:50:14 +0100, "bart" <bart@thatissec ret.nlm> wrote:
      [color=blue]
      >i run 4.3.4
      >
      >but is_dir doesn't work always.
      >
      >when i put a counter in a readdir loop, it returns the number 5
      >
      >that is;
      >
      >.
      >..
      >test1
      >test2
      >test3
      >
      >those are testdirectorys, but when i do a is_dir on the test directory it
      >doesn't return true!
      >
      >is this just a bug in 4.3.4 ?[/color]

      Can't say based on the lack of information you've posted. It's far, far more
      likely that there's a bug in your code, rather than a simple function like
      is_dir(), used by thousands of people, returns the wrong results. Maybe there
      is a bug in is_dir(), it's not impossible, but I'd bet the problem lies
      elsewhere.

      Show your code.
      Show a short runnable testcase.
      Show some proof that the names above actually are directories.
      etc.

      --
      Andy Hassall <andy@andyh.co. uk> / Space: disk usage analysis tool
      <http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>

      Comment

      • Chung Leong

        #4
        Re: is_dir problem

        *sigh* Another newbie blaming PHP for his own bug... You probably didn't
        append the parent path to the parameter to is_dir(). readdir() doesn't
        return the full path, just the name of the folder. Use glob() instead, it's
        easier to use.

        Uzytkownik "bart" <bart@thatissec ret.nlm> napisal w wiadomosci
        news:4054e1b6$0 $560$e4fe514c@n ews.xs4all.nl.. .[color=blue]
        > i run 4.3.4
        >
        > but is_dir doesn't work always.
        >
        > when i put a counter in a readdir loop, it returns the number 5
        >
        > that is;
        >
        > .
        > ..
        > test1
        > test2
        > test3
        >
        > those are testdirectorys, but when i do a is_dir on the test directory it
        > doesn't return true!
        >
        > is this just a bug in 4.3.4 ?
        >
        > do i need to compile a new version or is there another directory check
        > function?
        >
        > bart
        >
        >[/color]


        Comment

        • bart

          #5
          Re: is_dir problem

          you are right,

          thank you for helping me, that was indeed the problem.
          next time i should go to bed when it gets late and i start to get tired...
          (or drink more coffee)

          bye now

          "Chung Leong" <chernyshevsky@ hotmail.com> wrote in message
          news:ZbOdndU1Vb GMYcndRVn-gw@comcast.com. ..[color=blue]
          > *sigh* Another newbie blaming PHP for his own bug... You probably didn't
          > append the parent path to the parameter to is_dir(). readdir() doesn't
          > return the full path, just the name of the folder. Use glob() instead,[/color]
          it's[color=blue]
          > easier to use.[/color]


          Comment

          • bart

            #6
            Re: is_dir problem

            you are all right, it was my fault !

            thanks for replying ...

            grtx,
            Bart

            "Andy Hassall" <andy@andyh.co. uk> wrote in message
            news:88u950dp72 pq8b95vmh3mt5e0 2refv03u2@4ax.c om...[color=blue]
            > On Sun, 14 Mar 2004 23:50:14 +0100, "bart" <bart@thatissec ret.nlm> wrote:
            > Can't say based on the lack of information you've posted. It's far, far[/color]
            more[color=blue]
            > likely that there's a bug in your code, rather than a simple function like
            > is_dir(), used by thousands of people, returns the wrong results. Maybe[/color]
            there[color=blue]
            > is a bug in is_dir(), it's not impossible, but I'd bet the problem lies
            > elsewhere.
            >
            > Show your code.
            > Show a short runnable testcase.
            > Show some proof that the names above actually are directories.
            > etc.[/color]


            Comment

            Working...