mingw – Msys shell命令用于更改文件的属性

请告诉我一个可用于更改文件属性的MSYS
shell命令.当我以ls -l运行命令时,我得到以下内容:

-rw-r--r-- 1 lenovo Admin .....m4sugar.m4

我想提供完全访问权限.

任何帮助都非常感谢.

谢谢

最佳答案 @cdhowie是对的;这是msys跟踪的错误 – >

http://sourceforge.net/tracker/?func=detail&atid=102435&aid=3071537&group_id=2435

It cannot do anything more useful than it already does, unless it fakes it
in the POSIX emulation, as Cygwin does. However, what Cygwin does is
mostly irrelevant; since MSYS was forked from Cygwin-1.3, most of that
faking was deliberately disabled — it isn’t an objective of MSYS, to
provide faked POSIX features to the extent supported by Cygwin. If you
want Cygwin’s behaviour, and MSYS doesn’t retain it sufficiently for your
needs, then you should use Cygwin.

MSYS is designed to better integrate with the native MS-Windows features
supported by MinGW. In this native MS-Windows environment, there is no
file system attribute which can mark a file as executable — that is
indicated by magic byte sequences within the file’s data space, (and
usually also qualified by a file name extension to match). There is no way
MSYS chmod can safely modify that, without risk of file corruption, other
than by more completely embracing Cygwin’s emulation. However, that is
diametrically opposed to the MSYS Project objectives — it just ain’t going
to happen.

@kbulgrien提供了更改权限的好方法:

> cacls:http://ss64.com/nt/cacls.html,或
> icacls:http://ss64.com/nt/icacls.html

注意:icacls是新版本的cacls纠正了几个问题但似乎在Windows XP中不存在.

您可以使用以下任一命令为Everyone提供完全访问权限:

> cacls“$file_path”// E // P每个人:F
> icacls“$file_path”//授予每个人:F

请注意,在使用cacls或icacls之后,Msys中的ls -l将无法显示有关实际ACL的准确信息.

点赞