Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Directories

  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Paris, France
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 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
    Regular Coder
    Join Date
    May 2002
    Location
    London, England
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Jeewhizz - MySQL Moderator
    http://www.sitehq.co.uk
    PHP and MySQL Hosting

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Paris, France
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #4
    New Coder
    Join Date
    Jul 2002
    Location
    Behind my PC :)
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    uh...

    total_space - free_space = space_that_is_used

    or am I saying stupid things now?

  • #5
    New Coder
    Join Date
    Jul 2002
    Location
    Regina, Saskatchewan, Canada
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    New Coder
    Join Date
    Jun 2002
    Location
    Paris, France
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    disk_total_space(string dirname) -
    http://www.php.net/manual/en/functio...otal-space.php

    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.

  • #8
    New Coder
    Join Date
    Jun 2002
    Location
    Paris, France
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you
    I don't suffer from insanity, I enjoy every single minute of it!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •