… | |
… | |
1776 | $cf::MAP{$self->path} = $self; |
1776 | $cf::MAP{$self->path} = $self; |
1777 | |
1777 | |
1778 | $self->reset; # polite request, might not happen |
1778 | $self->reset; # polite request, might not happen |
1779 | } |
1779 | } |
1780 | |
1780 | |
|
|
1781 | =item $maps = cf::map::tmp_maps |
|
|
1782 | |
|
|
1783 | Returns an arrayref with all map paths of currently instantiated and saved |
|
|
1784 | maps. May block. |
|
|
1785 | |
|
|
1786 | =cut |
|
|
1787 | |
|
|
1788 | sub tmp_maps() { |
|
|
1789 | [ |
|
|
1790 | map { |
|
|
1791 | utf8::decode $_; |
|
|
1792 | /\.map$/ |
|
|
1793 | ? normalise $_ |
|
|
1794 | : () |
|
|
1795 | } @{ aio_readdir $TMPDIR or [] } |
|
|
1796 | ] |
|
|
1797 | } |
|
|
1798 | |
|
|
1799 | =item $maps = cf::map::random_maps |
|
|
1800 | |
|
|
1801 | Returns an arrayref with all map paths of currently instantiated and saved |
|
|
1802 | random maps. May block. |
|
|
1803 | |
|
|
1804 | =cut |
|
|
1805 | |
|
|
1806 | sub random_maps() { |
|
|
1807 | [ |
|
|
1808 | map { |
|
|
1809 | utf8::decode $_; |
|
|
1810 | /\.map$/ |
|
|
1811 | ? normalise "?random/$_" |
|
|
1812 | : () |
|
|
1813 | } @{ aio_readdir $RANDOMDIR or [] } |
|
|
1814 | ] |
|
|
1815 | } |
|
|
1816 | |
1781 | =item cf::map::unique_maps |
1817 | =item cf::map::unique_maps |
1782 | |
1818 | |
1783 | Returns an arrayref of paths of all shared maps that have |
1819 | Returns an arrayref of paths of all shared maps that have |
1784 | instantiated unique items. May block. |
1820 | instantiated unique items. May block. |
1785 | |
1821 | |
1786 | =cut |
1822 | =cut |
1787 | |
1823 | |
1788 | sub unique_maps() { |
1824 | sub unique_maps() { |
1789 | my $files = aio_readdir $UNIQUEDIR |
1825 | [ |
1790 | or return; |
1826 | map { |
1791 | |
|
|
1792 | my @paths; |
|
|
1793 | |
|
|
1794 | for (@$files) { |
|
|
1795 | utf8::decode $_; |
1827 | utf8::decode $_; |
1796 | next if /\.pst$/; |
1828 | /\.map$/ |
1797 | next unless /^$PATH_SEP/o; |
1829 | ? normalise $_ |
1798 | |
1830 | : () |
1799 | push @paths, cf::map::normalise $_; |
1831 | } @{ aio_readdir $UNIQUEDIR or [] } |
1800 | } |
1832 | ] |
1801 | |
|
|
1802 | \@paths |
|
|
1803 | } |
1833 | } |
1804 | |
1834 | |
1805 | package cf; |
1835 | package cf; |
1806 | |
1836 | |
1807 | =back |
1837 | =back |