random file from subdirectories?

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

    random file from subdirectories?

    Hi,

    how would I make a script that pics a random file from a tree?
    Is there something like this existing? I need one that can handle many
    files on a large tree.

    thanks

    Oliver

  • Martin Wickman

    #2
    Re: random file from subdirectories?

    In article <Xns93F5AF545EA E3oliveremailch @63.223.5.254>, Oliver Spiesshofer wrote:[color=blue]
    > Hi,
    >
    > how would I make a script that pics a random file from a tree?
    > Is there something like this existing? I need one that can handle many
    > files on a large tree.[/color]

    Read all filenames into an array using readdir et al, and then

    $random_file = array_rand($all _files);

    Comment

    Working...