… | |
… | |
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. |
|
|
1785 | |
|
|
1786 | =cut |
|
|
1787 | |
|
|
1788 | sub tmp_maps() { |
|
|
1789 | [ |
|
|
1790 | map { |
|
|
1791 | utf8::decode $_; |
|
|
1792 | !/\.(?:pst|meta)$/ && /^$PATH_SEP/o |
|
|
1793 | ? normalise $_ |
|
|
1794 | : () |
|
|
1795 | } @{ aio_readdir $TMPDIR or [] } |
|
|
1796 | ] |
|
|
1797 | } |
|
|
1798 | |
1781 | =item cf::map::unique_maps |
1799 | =item cf::map::unique_maps |
1782 | |
1800 | |
1783 | Returns an arrayref of paths of all shared maps that have |
1801 | Returns an arrayref of paths of all shared maps that have |
1784 | instantiated unique items. May block. |
1802 | instantiated unique items. May block. |
1785 | |
1803 | |
1786 | =cut |
1804 | =cut |
1787 | |
1805 | |
1788 | sub unique_maps() { |
1806 | sub unique_maps() { |
1789 | my $files = aio_readdir $UNIQUEDIR |
1807 | [ |
1790 | or return; |
1808 | map { |
1791 | |
|
|
1792 | my @paths; |
|
|
1793 | |
|
|
1794 | for (@$files) { |
|
|
1795 | utf8::decode $_; |
1809 | utf8::decode $_; |
1796 | next if /\.pst$/; |
1810 | !/\.(?:pst|meta)$/ && /^$PATH_SEP/o |
1797 | next unless /^$PATH_SEP/o; |
1811 | ? normalise $_ |
1798 | |
1812 | : () |
1799 | push @paths, cf::map::normalise $_; |
1813 | } @{ aio_readdir $UNIQUEDIR or [] } |
1800 | } |
1814 | ] |
1801 | |
|
|
1802 | \@paths |
|
|
1803 | } |
1815 | } |
1804 | |
1816 | |
1805 | package cf; |
1817 | package cf; |
1806 | |
1818 | |
1807 | =back |
1819 | =back |