File-Trash-FreeDesktop
view release on metacpan or search on metacpan
$trash->recover({on_not_found=>'ignore', on_target_exists=>'ignore'}, '/path');
# empty a trash directory
$trash->empty("$ENV{HOME}/.local/share/Trash");
# empty all available trashes
$trash->empty;
DESCRIPTION
This module lets you trash/erase/restore files, also list the contents
of trash directories. This module follows the freedesktop.org trash
specification [1], with some notes/caveats:
* For home trash, $HOME/.local/share/Trash is used instead of
$HOME/.Trash
This is what KDE and GNOME use these days.
* Symlinks are currently not checked
The spec requires implementation to check whether trash directory is
HOMEPAGE
Please visit the project's homepage at
<https://metacpan.org/release/File-Trash-FreeDesktop>.
SOURCE
Source repository is at
<https://github.com/perlancar/perl-File-Trash-FreeDesktop>.
SEE ALSO
Specification
<https://freedesktop.org/wiki/Specifications/trash-spec>
CLI utilities
* App::TrashUtils
A set of CLI's written in Perl: trash-empty, trash-list,
trash-list-trashes, trash-put, trash-restore, trash-rm.
* trash-u (from App::trash::u)
An alternative CLI, with undo support.
lib/File/Trash/FreeDesktop.pm view on Meta::CPAN
our $DIST = 'File-Trash-FreeDesktop'; # DIST
our $VERSION = '0.207'; # VERSION
sub new {
require File::HomeDir::FreeDesktop;
my ($class, %opts) = @_;
my $home = File::HomeDir::FreeDesktop->my_home
or die "Can't get homedir, ".
"probably not a freedesktop-compliant environment?";
$opts{_home} = l_abs_path($home);
bless \%opts, $class;
}
sub _mk_trash {
my ($self, $trash_dir) = @_;
for ("", "/files", "/info") {
my $d = "$trash_dir$_";
unless (-d $d) {
lib/File/Trash/FreeDesktop.pm view on Meta::CPAN
# empty a trash directory
$trash->empty("$ENV{HOME}/.local/share/Trash");
# empty all available trashes
$trash->empty;
=head1 DESCRIPTION
This module lets you trash/erase/restore files, also list the contents of trash
directories. This module follows the freedesktop.org trash specification [1],
with some notes/caveats:
=over
=item * For home trash, $HOME/.local/share/Trash is used instead of $HOME/.Trash
This is what KDE and GNOME use these days.
=item * Symlinks are currently not checked
lib/File/Trash/FreeDesktop.pm view on Meta::CPAN
Please visit the project's homepage at L<https://metacpan.org/release/File-Trash-FreeDesktop>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-File-Trash-FreeDesktop>.
=head1 SEE ALSO
=head2 Specification
L<https://freedesktop.org/wiki/Specifications/trash-spec>
=head2 CLI utilities
=over
=item * App::TrashUtils
A set of CLI's written in Perl: L<trash-empty>, L<trash-list>,
L<trash-list-trashes>, L<trash-put>, L<trash-restore>, L<trash-rm>.
( run in 0.243 second using v1.01-cache-2.11-cpan-299005ec8e3 )