updatedb
This commit is contained in:
25
public/home/admin/event/listImages.pl
Executable file
25
public/home/admin/event/listImages.pl
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/perl
|
||||
use warnings;
|
||||
use strict;
|
||||
use JSON;
|
||||
use Cwd 'abs_path';
|
||||
use lib abs_path("../../")."/sibelius2/conf";
|
||||
use Paths;
|
||||
#-------------------------
|
||||
print getNames( Paths::MOD ."/cal/img");
|
||||
sub getNames{
|
||||
my $dir = shift;
|
||||
my @file_name;
|
||||
opendir(DIR, $dir) or die "error opening dir: $dir \n$!";
|
||||
while (my $file = readdir(DIR)) {
|
||||
next unless ( $file =~m/^[\w\d]/);
|
||||
next unless (-f "$dir/$file");
|
||||
push(@file_name,{name=>$file,tag=>"ilist"});
|
||||
}
|
||||
closedir(DIR);
|
||||
return encode_json( \@file_name );
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
Reference in New Issue
Block a user