bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inconsistent behaviour stripping / from end of filenames


From: Edward Avis
Subject: Inconsistent behaviour stripping / from end of filenames
Date: Wed, 12 Sep 2001 10:08:35 +0100 (BST)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

% mkdir test
% cd test
% touch a
% cp a/ b
cp: cannot stat `a/': Not a directory
% rm -v a/
removing `a'

It seems that rm strips the trailing slashes off a filename, even when
the file is not a directory.  But cp does not.  To me it seems kinda
wrong to accept the trailing slashes for a regular file, but anyway,
all the fileutils ought to have the same policy on this.

I went through all the programs of fileutils and found that chmod,
chown, rm and du will accept trailing slashes on regular file names.
All the others will (correctly, IMHO) give an error, usually 'Not a
directory'.  I didn't test mkdir, mknod, sync, dircolors or mkfifo.

The error message from touch is interesting:

% touch a
% touch a/
touch: creating `a/': Is a directory

I'm using fileutils 4.0.36 on Red Hat Linux 7.1 (glibc 2.2.2, Linux
2.4.3).

- -- 
Ed Avis <address@hidden>
Finger for PGP key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7nyYVIMp73jhGogoRAqS5AJ42HEdfowS1w86nIx8DW/LqrX8ZHwCfdLT0
ZDv559WOEHuKzK9QcEICjKc=
=WzhQ
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]