summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 98ee1a6)
raw | patch | inline | side by side (parent: 98ee1a6)
author | Aman Gupta <aman@tmm1.net> | |
Sat, 22 Aug 2009 12:07:26 +0000 (14:07 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 22 Aug 2009 12:10:53 +0000 (14:10 +0200) |
contrib/collection3/lib/Collectd/Graph/Common.pm | patch | blob | history |
diff --git a/contrib/collection3/lib/Collectd/Graph/Common.pm b/contrib/collection3/lib/Collectd/Graph/Common.pm
index b445c8e45e9736feb2082eb34f147c79d9e297a6..6019edb4f633aee14e37fd138631bfe6105ddbc2 100644 (file)
my $recursive = @_ ? shift : 0;
my $dh;
my @directories = ();
+ my @files = ();
my $ret = [];
opendir ($dh, $dir) or die ("opendir ($dir): $!");
}
elsif (-f $entry)
{
- my $ident = filename_to_ident ($entry);
- if ($ident)
- {
- push (@$ret, $ident);
- }
+ push (@files, $entry);
}
}
closedir ($dh);
+ push (@$ret, map { filename_to_ident ($_) } sort (@files));
+
if ($recursive > 0)
{
for (@directories)
my $temp = get_files_from_directory ($_, $recursive - 1);
if ($temp && @$temp)
{
- push (@$ret, @$temp);
+ push (@$ret, @$temp);
}
}
}