{"id":7284,"date":"2022-12-20T19:37:35","date_gmt":"2022-12-20T22:37:35","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/fileremove-man3\/"},"modified":"2022-12-20T19:37:35","modified_gmt":"2022-12-20T22:37:35","slug":"fileremove-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/fileremove-man3\/","title":{"rendered":"File::Remove (man3)"},"content":{"rendered":"<h1 align=\"center\">File::Remove<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#VERSION\">VERSION<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SUBROUTINES\">SUBROUTINES<\/a><br \/> <a href=\"#SUPPORT\">SUPPORT<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a><br \/> <a href=\"#SUPPORT\">SUPPORT<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#COPYRIGHT AND LICENSE\">COPYRIGHT AND LICENSE<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">File::Remove \u2212 Remove files and directories<\/p>\n<h2>VERSION <a name=\"VERSION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">version 1.60<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use File::Remove &#8216;remove&#8217;; <br \/> # removes (without recursion) several files <br \/> remove( &#8216;*.c&#8217;, &#8216;*.pl&#8217; ); <br \/> # removes (with recursion) several directories <br \/> remove( 1, qw{directory1 directory2} ); <br \/> # removes (with recursion) several files and directories <br \/> remove( 1, qw{file1 file2 directory1 *~} ); <br \/> # removes without globbing: <br \/> remove( 1, {glob => 0}, &#8216;*&#8217;); <br \/> # trashes (with support for undeleting later) several files <br \/> trash( &#8216;*~&#8217; );<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>File::Remove::remove<\/b> removes files and directories. It acts like <b>\/bin\/rm<\/b>, for the most part. Although &#8220;unlink&#8221; can be given a list of files, it will not remove directories; this module remedies that. It also accepts wildcards, bodies manpages.csv script_extrae_body.sh script.sh usr and ?, as arguments for filenames.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>File::Remove::trash<\/b> accepts the same arguments as <b>remove<\/b>, with the addition of an optional, infrequently used &#8220;other platforms&#8221; hashref.<\/p>\n<h2>SUBROUTINES <a name=\"SUBROUTINES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>remove<\/b> <br \/> Removes files and directories. Directories are removed recursively like in <b>rm \u2212rf<\/b> if the first argument is a reference to a scalar that evaluates to true. If the first argument is a reference to a scalar, then it is used as the value of the recursive flag. By default it\u2019s false so only pass 1 to it.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the next argument is a hash reference then it is a key\/values of options. Currently, there is one supported option of &#8220;&#8216;glob&#8217; => 0&#8221; which prevents globbing. E.g:<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">remove(1, {glob => 0}, &#8216;*&#8217;);<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Will not remove files globbed by \u2019*\u2019 and will only remove the file called asterisk if it exists.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In list context it returns a list of files\/directories removed, in scalar context it returns the number of files\/directories removed. The list\/number should match what was passed in if everything went well.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>rm<\/b> <br \/> Just calls <b>remove<\/b>. It\u2019s there for people who get tired of typing <b>remove<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>clear<\/b> <br \/> The &#8220;clear&#8221; function is a version of &#8220;remove&#8221; designed for use in test scripts. It takes a list of paths that it will both initially delete during the current test run, and then further flag for deletion at END-time as a convenience for the next test run.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>trash<\/b> <br \/> Removes files and directories, with support for undeleting later. Accepts an optional &#8220;other platforms&#8221; hashref, passing the remaining arguments to <b>remove<\/b>. <br \/> Win32<\/p>\n<p style=\"margin-left:17%;\">Requires Win32::FileOp.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Installation not actually enforced on Win32 yet, since Win32::FileOp has badly failing dependencies at time of writing.<\/p>\n<p style=\"margin-left:11%;\"><small>OS X<\/small><\/p>\n<p style=\"margin-left:17%;\">Requires Mac::Glue.<\/p>\n<p style=\"margin-left:11%;\">Other platforms<\/p>\n<p style=\"margin-left:17%;\">The first argument to <b>trash()<\/b> must be a hashref with two keys, \u2019rmdir\u2019 and \u2019unlink\u2019, each referencing a coderef. The coderefs will be called with the filenames that are to be deleted.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>expand <small><br \/> DO NOT USE.<\/small><\/b> Kept for legacy.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>undelete <small><br \/> DO NOT USE.<\/small><\/b> Kept for legacy.<\/p>\n<h2>SUPPORT <a name=\"SUPPORT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Bugs should always be submitted via the <small>CPAN<\/small> bug tracker<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><http:\/\/rt.cpan.org\/NoAuth\/ReportBug.html?Queue=File\u2212Remove><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For other issues, contact the maintainer.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Adam Kennedy <adamk@cpan.org><\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Taken over by Shlomi Fish (<http:\/\/www.shlomifish.org\/>) while disclaiming all rights and placing his modifications under CC0\/public\u2212domain\/MIT\/any\u2212other\u2212licence.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Some parts copyright 2006 \u2212 2012 Adam Kennedy.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Taken over by Adam Kennedy <adamk@cpan.org> to fix the &#8220;deep readonly files&#8221; bug, and do some package cleaning.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Some parts copyright 2004 \u2212 2005 Richard Soderberg.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Taken over by Richard Soderberg <perl@crystalflame.net> to port it to File::Spec and add tests.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Original copyright: 1998 by Gabor Egressy, <gabor@vmunix.com>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This program is free software; you can redistribute and\/or modify it under the same terms as Perl itself.<\/p>\n<h2>SUPPORT <a name=\"SUPPORT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Websites<\/b> <br \/> The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"12%\">\n<p>MetaCPAN<\/p>\n<\/td>\n<td width=\"71%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">A modern, open-source <small>CPAN<\/small> search engine, useful to view <small>POD<\/small> in <small>HTML<\/small> format.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><https:\/\/metacpan.org\/release\/File\u2212Remove><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"34%\">\n<p style=\"margin-top: 1em\"><small>RT: CPAN<\/small> \u2019s Bug Tracker<\/p>\n<\/td>\n<td width=\"49%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The <small>RT<\/small> ( Request Tracker ) website is the default bug\/issue tracking system for <small>CPAN.<\/small><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><https:\/\/rt.cpan.org\/Public\/Dist\/Display.html?Name=File\u2212Remove><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><small>CPANTS<\/small><\/p>\n<\/td>\n<td width=\"74%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The <small>CPANTS<\/small> is a website that analyzes the Kwalitee ( code metrics ) of a distribution.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><http:\/\/cpants.cpanauthors.org\/dist\/File\u2212Remove><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"18%\">\n<p style=\"margin-top: 1em\"><small>CPAN<\/small> Testers<\/p>\n<\/td>\n<td width=\"65%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The <small>CPAN<\/small> Testers is a network of smoke testers who run automated tests on uploaded <small>CPAN<\/small> distributions.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><http:\/\/www.cpantesters.org\/distro\/F\/File\u2212Remove><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"29%\">\n<p style=\"margin-top: 1em\"><small>CPAN<\/small> Testers Matrix<\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The <small>CPAN<\/small> Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls\/platforms.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><http:\/\/matrix.cpantesters.org\/?dist=File\u2212Remove><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"38%\">\n<p style=\"margin-top: 1em\"><small>CPAN<\/small> Testers Dependencies<\/p>\n<\/td>\n<td width=\"45%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">The <small>CPAN<\/small> Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><http:\/\/deps.cpantesters.org\/?module=File::Remove><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Bugs \/ Feature Requests<\/b> <br \/> Please report any bugs or feature requests by email to &#8220;bug\u2212file\u2212remove at rt.cpan.org&#8221;, or through the web interface at <https:\/\/rt.cpan.org\/Public\/Bug\/Report.html?Queue=File\u2212Remove>. You will be automatically notified of any progress on the request by the system.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Source Code<\/b> <br \/> The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository \ud83d\ude42<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><https:\/\/github.com\/shlomif\/File\u2212Remove><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">git clone git:\/\/github.com\/shlomif\/File\u2212Remove.git<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Shlomi Fish <shlomif@cpan.org><\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Please report any bugs or feature requests on the bugtracker website <http:\/\/rt.cpan.org\/NoAuth\/Bugs.html?Dist=File\u2212Remove> or by email to bug\u2212file\u2212remove@rt.cpan.org <mailto:bug-file-remove@rt.cpan.org>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.<\/p>\n<h2>COPYRIGHT AND LICENSE <a name=\"COPYRIGHT AND LICENSE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This software is copyright (c) 1998 by Gabor Egressy.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This is free software; you can redistribute it and\/or modify it under the same terms as the Perl 5 programming language system itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  File::Remove \u2212 Remove files and directories <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3608,3007],"class_list":["post-7284","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-fileremove","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7284"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7284\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}