Web Analytics Made Easy -
StatCounter Directories - CodingForum

Announcement

Collapse
No announcement yet.

Directories

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Directories

    Is their a special function to count how many space the files are taking up in a directory or must I use the readdir function with a few loops and add the space each file takes individually?
    I don't suffer from insanity, I enjoy every single minute of it!

  • #2


    Try that

    Jee
    Jeewhizz - MySQL Moderator
    http://www.sitehq.co.uk
    PHP and MySQL Hosting

    Comment


    • #3
      I don't want the space available I want the space used....
      I don't suffer from insanity, I enjoy every single minute of it!

      Comment


      • #4
        uh...

        total_space - free_space = space_that_is_used

        or am I saying stupid things now?

        Comment


        • #5
          If you did use a readdir, you could count each one...

          while ($file = readdir($dir_var)) {
          $filesize = $filesize + filesize($file);
          }

          echo "The total space used is: " . $filesize;
          Jared Brandt
          IKinsler

          Comment


          • #6
            Yea I know, just wondering if there was no specific function to do that. Thanks anyways
            I don't suffer from insanity, I enjoy every single minute of it!

            Comment


            • #7
              disk_total_space(string dirname) -


              should do it - I used it today on localhost and got absolutely no
              return though and ergo went with the filesize(each file) method.
              ضkii - formerly pootergeist
              teckis - take your time and it'll save you time.

              Comment


              • #8
                Thank you
                I don't suffer from insanity, I enjoy every single minute of it!

                Comment

                Working...
                X