[Date Prev]   [Date Next] [Thread Prev]   [Thread Next] [Date Index]   [Thread Index]


     Re: [snips-users] rrdgraph.cgi

On Fri, Feb 20, 2004 at 12:26:29PM -0400, Daniel MacKay wrote:
> I notice that rrdgraph.cgi uses:
> 	   @rrdfiles = grep (/.+\.rrd/i, readdir(REALDIR) );
> and then later:
> 	  foreach my $rfile (@rrdfiles)
> which results in a more or less random display of the graphs.  It's 
> not random, of course - it's the directory order so it's always the 
> same UNLESS you add or take away graphs, in which case it's not in 
> any decipherable order or one that you can control.
> I have changed the above line to read:
> 	foreach my $rfile (sort @rrdfiles)
> which at least puts them in alphabetical order.

Well, in theory directory order /should/ be alphabetical, though some
OS' may do slightly different things -- like put caps first, or
directories in front of files, or a combination there-of... the problem
with sort is it tends to be slow over large lists.

But, in the effort of trying to "force" some consistency, I've added
this with the caveat that large directories might be a tad slower due
to the sort algorithm.  It's commited to CVS at this point.


Russell M. Van Tassell
russell at loosenut com


Zyrion Traverse Network Monitoring & Network Management Software