#637522 coreutils: [rm] symlinks - cannot remove `<dir>/': Is a directory

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
Jari Aalto
Date:
2021-09-22 04:46:28 UTC
Severity:
minor
#637522#5
Date:
2011-08-12 09:57:04 UTC
From:
To:
The rm(1) is little too simplistic to assume that trailing "/" is automatically a directory:

    $ ls -l
    lrwxrwxrwx   1 foo foo    15 Aug 12 10:53 monitor -> tmp/bug/monitor

    $ rm monitor/
    rm: cannot remove `monitor/': Is a directory

Whereas:

    $ rm monitor
    <no messages>

SUGGESTION

Please do a "unlink" regardless of checking if there is trailing slash
or not in the command line item string. If the unlink fails, then
return the error to the user.[*]

[*] there is no need to check "stat" either to verify that item is
non-directory as the error code of "unlink" would automatically notify
if the operation succeeds or not.

#637522#10
Date:
2011-08-12 10:37:40 UTC
From:
To:
Unfortunately POSIX requires that path names with trailing slashes are
treated as if '.' had been appended to them, i.e. as directories.  It
might be useful to implement a "--strip-trailing-slashes" option¹ for rm
so that you can create a suitable alias.

Cheers,
       Sven


¹ http://www.gnu.org/s/coreutils/manual/html_node/Trailing-slashes.html

#637522#15
Date:
2021-09-22 04:26:15 UTC
From:
To:
Hello,

Good morning,

We have gone through your samples from a partner and Here is our  Order
List. Please do bear in mind that we are very much in  need of this
order, quote your competitive prices.

Kindly send the Order confirmation.

Your early reply will be much appreciated.

Best Regards,

Maryanah Erwin.

PT FINDORA INTERNUSA

Jln Pahlawan 66 Kec. Arjawinangun

45162 CIREBON West-Java INDONESIA

tel : +62 231 357334

fax: +62 231 357260

email: marketing@findora.com