Re: dir() class suggestion
| From: | Maxim Maletsky | Date: | Wed, 06 Nov 2002 16:47:02 +0000 |
| Subject: | Re: dir() class suggestion | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-90569@lists.php.net to get a copy of this message | ||
bugs.php.net is kind of a better place...
As of your question:
I disagree there should be a sorting feature. You can use your own
sorting logic while looping the returned array, not telling PHP how to
give you the directory contents.
How would you go with limiting size? You'd need to specify sorting
method, and pass min/max ranges, and then, perhaps, to also ask to order
alphabetically....
I think returning you an array is better for you as well since you'd get
a better result yourself sorting on your own and free up the system.
have you ever tried using `` quotes?
echo
ls -la;
you get the linux directory output.
--
Maxim Maletsky
maxim@php.net
"Boris Penck" <boris@gamate.com> wrote... :
> Hi there,
>
> today I was playing around with dir() and my problem is that there is no
> chance to tell dir()
> weather to sort the files and directories. Sure, I'm able to read, dump
> all entries to an array, sort and
> print out the result. In cases with recursive directory trees a very bad
> idea if the tree contains a large
> number of subdirectories.
>
> Well, my wish is something like that:
>
> dir(string path [, sort method]) for sorting against name, size, date -
> ok name may be a very good start.
>
> At the moment $d = dir('./'); [...] $d->read(); will produce a result
> like ls -la -U -- an unsorted way.
>
> best regards
> boris
>
> ( i hope i found the right place for these wishes )
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>