General discussion


Folder Contents

By jped ·

We have a network drive where we allow users to store their own files. We
like to keep the number of picture files, executables, etc. down. I am
looking for a script or an application that will count the number of a specified file and where
it is located. For example, the folder structure is setup where we have a
root folder, and under that is each user's personal folder. I would like it
to tell me that user1 has 12 jpegs, user2 has 20 jpegs, etc. Is there a
script or application that can do this so I don't have to manually count the files? Thanks!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by kylew In reply to Folder Contents

> If you have PHP, you can use this script:
> <?
> $dir_handle = @opendir($path) or die("Unable to open $path");
> echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
> echo "<photos>";
> while ($file = readdir($dir_handle)) {
> if (substr($file, -4) == ".jpg") {
> echo "<picture filename=\"$file\">\n";
> }
> }
> echo"</photos>";
> closedir($dir_handle);
> ?>
> It'll return an XML document with the names of all the files...
> Hope this was helpful.

Collapse -

by jped In reply to Folder Contents

I don't have PHP, is it easy to implement?


Related Discussions

Related Forums