Subject: Re: bug#41570: 26.3; dired chown

From: "A. Peter Blicher" <[email-masked]>
Date: Thu, 28 May 2020 08:54:29 -0700

Correct, takeown is not the same as chown.  Also, Windows is not the same as 
Unix, unfortunately.  takeown provides some of the capability of chown, thus 
it would be useful to have that functionality.  Yes, the logged in user must 
have, as far as I know, admin privilege to use it, i.e. be 'elevated'. 
However, I would find that bit of functionality useful.  No, takeown is not a 
replacement for chown, it's just a tiny bit of extra functionality in the 
same vein.

The main reason I have more use for chown in windows compared to when I was 
using Unix is that Windows creates a profusion of different ownerships even 
for files I create under a single user (depending on how they were created), 
resulting in a mess that I often need to clean up.  That mess is most evident 
using Dired, because it shows ownership by default, while usually Windows 
hides that information.

The requirement for elevated privilege is not an issue for me, because I run 
in that mode all the time, against all advice, mainly because Windows' 
permission handling is so screwed up and opaque.  However, for those who 
don't, that might either require extra code to handle, or maybe Windows would 
raise an elevation prompt dialog, not sure.

Thanks for considering it.

--peter

On 5/27/2020 11:44 PM, Eli Zaretskii wrote:
>> From: "A. Peter Blicher" <[email-masked]>
>> Date: Wed, 27 May 2020 14:46:39 -0700
>>
>> Dired chown command complains that chown is not available for windows
>> systems.  However, windows versions >= 7 (at least) have the "takeown"
>> command, which while not as comprehensive as the unix chown command at
>> least allows the current user to take ownership of a file/dir, as long
>> as the user has admin privileges.  It would be useful for dired to
>> permit this possibility on windows systems.
> 
> AFAIU, 'takeown' is different from 'chown', in that it only allows to
> change the file's owner to either the current user or the
> Administrators group, it doesn't allow you to change the ownership to
> any other user except one of those two.  Also, I think the command
> requires elevation, doesn't it (thus you mention "admin privileges")?
> 
> So I'm not sure that command is a good replacement for 'chown', but
> maybe you have something in mind I'm missing?
> 
> Thanks.
>