… | |
… | |
2339 | /\.pst$/ || !/^$PATH_SEP/o # TODO unique maps apparebntly lack the .map suffix :/ |
2339 | /\.pst$/ || !/^$PATH_SEP/o # TODO unique maps apparebntly lack the .map suffix :/ |
2340 | ? () |
2340 | ? () |
2341 | : normalise $_ |
2341 | : normalise $_ |
2342 | } @{ aio_readdir $UNIQUEDIR or [] } |
2342 | } @{ aio_readdir $UNIQUEDIR or [] } |
2343 | ] |
2343 | ] |
|
|
2344 | } |
|
|
2345 | |
|
|
2346 | =item cf::map::static_maps |
|
|
2347 | |
|
|
2348 | Returns an arrayref if paths of all static maps (all preinstalled F<.map> |
|
|
2349 | file in the shared directory excluding F</styles> and F</editor>). May |
|
|
2350 | block. |
|
|
2351 | |
|
|
2352 | =cut |
|
|
2353 | |
|
|
2354 | sub static_maps() { |
|
|
2355 | my @dirs = ""; |
|
|
2356 | my @maps; |
|
|
2357 | |
|
|
2358 | while (@dirs) { |
|
|
2359 | my $dir = shift @dirs; |
|
|
2360 | |
|
|
2361 | next if $dir eq "/styles" || $dir eq "/editor"; |
|
|
2362 | |
|
|
2363 | my ($dirs, $files) = Coro::AIO::aio_scandir "$MAPDIR$dir", 2 |
|
|
2364 | or return; |
|
|
2365 | |
|
|
2366 | for (@$files) { |
|
|
2367 | s/\.map$// or next; |
|
|
2368 | utf8::decode $_; |
|
|
2369 | push @maps, "$dir/$_"; |
|
|
2370 | } |
|
|
2371 | |
|
|
2372 | push @dirs, map "$dir/$_", @$dirs; |
|
|
2373 | } |
|
|
2374 | |
|
|
2375 | \@maps |
2344 | } |
2376 | } |
2345 | |
2377 | |
2346 | =back |
2378 | =back |
2347 | |
2379 | |
2348 | =head3 cf::object |
2380 | =head3 cf::object |