emacs-bug-tracker
[Top][All Lists]
Advanced

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

[Emacs-bug-tracker] bug#6245: closed (cp - copy files and directories, l


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#6245: closed (cp - copy files and directories, ls -Rld, chmod)
Date: Sat, 22 May 2010 19:35:01 +0000

Your message dated Sat, 22 May 2010 13:34:00 -0600
with message-id <address@hidden>
and subject line Re: bug#6245: cp - copy files and directories, ls -Rld, chmod
has caused the GNU bug report #6245,
regarding cp - copy files and directories, ls -Rld, chmod
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
6245: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6245
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: cp - copy files and directories, ls -Rld, chmod Date: Sat, 22 May 2010 00:19:30 -0700 (PDT)
Hi,

1. The copy command  cp -a


-a, --archive
              same as -dpR

-p     same as --preserve=mode,ownership,timestamps


is not doing what it is supposed to do (and thats is fine, of course), because It does not preserve ownership (except if you are root) . The problem is that it doesn't tell you anything when it doesn't do it or that It shouldn't be supposed to preserve ownership.
-------------------
2. Many commands act recursively on a directory with an -R option that affects the directory and all the files it contains.

There should be a

ls -ld -R

command that lists in detail the directory and its contents to quickly check results in one step.
--------------------------------
3. If we have:

drwx------ 2 user2 user2  392 2010-01-11 12:04 /home/user2/directory

address@hidden:~$ su  -c 'chmod -R 644 /home/user2/directory' user2

doesn't work. You need to change the mode of the directory first and then you can apply a recursive chmod. Is this a bug?

Many thanx for many things.
:-)



--- End Message ---
--- Begin Message --- Subject: Re: bug#6245: cp - copy files and directories, ls -Rld, chmod Date: Sat, 22 May 2010 13:34:00 -0600 User-agent: Mutt/1.5.18 (2008-05-17)
address@hidden wrote:
> course), because It does not preserve ownership (except if you are
> root) . The problem is that it doesn't tell you anything when it
> doesn't do it or that It shouldn't be supposed to preserve
> ownership.

This is related to this FAQ entry.  It explains why only root can
chown files.

  http://www.gnu.org/software/coreutils/faq/#Why-can-only-root-chown-files_003f

The 'cp -a' option says:

  `-a'
  `--archive'
      Preserve as much as possible of the structure and attributes of the
      original files in the copy ...

It is not possible to preserve the ownership of a file unless you are
root.  Therefore cp is preserving "as much as possible".

> 2. Many commands act recursively on a directory with an -R option
> that affects the directory and all the files it contains.
> 
> There should be a
> 
> ls -ld -R
> 
> command that lists in detail the directory and its contents to
> quickly check results in one step.

The -R option is exactly the option you are asking for except you have
explicitly blocked its action by adding the -d option.

  `-R'
  `--recursive'
       List the contents of all directories recursively.

This does what you intend.

  `-d'
  `--directory'
       List just the names of directories, as with other types of files,
       rather than listing their contents.

But you included the -d option that prevents it from recursing.

> 3. If we have:
> 
> drwx------ 2 user2 user2  392 2010-01-11 12:04 /home/user2/directory
> 
> address@hidden:~$ su  -c 'chmod -R 644 /home/user2/directory' user2
> 
> doesn't work. You need to change the mode of the directory first and
> then you can apply a recursive chmod. Is this a bug?

Mode 644 isn't what you want for directories.  That would remove the
eXecute bit.  The execute permission on a directory allows access to
list the contents of the directory.  If that permission is removed
then the chmod command will not have access to list the directory
contents.

You probably want something that only affects files.  Use find for
that instead.  Try something like this:

  su -c 'find /home/user2/directory -type f -exec chmod 644 {} +' user2

> Many thanx for many things.

When reporting bugs (or at least when reporting what you are thinking
is a bug :-) it is best to report only one item at a time.  Mixing
several items together causes all of them to be treated together as a
group even if they are individually separate.

Since none of these were bugs I am going to go ahead and mark it as
being closed in the bug tracker.  Feel free to follow-up normally if
you have more information.  In the future for general help with the
utilities you might want to ask general help questions in the
address@hidden mailing list.

Bob


--- End Message ---

reply via email to

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