gpt4 book ai didi

mingw - Msys shell 命令更改文件的属性

转载 作者:行者123 更新时间:2023-12-02 19:28:29 31 4
gpt4 key购买 nike

请告诉我一个可用于更改文件属性的 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 给出了更改权限的好方法:

注意:icaclscacls的新版本纠正了几个问题,但 Windows XP 中似乎不存在。

您可以使用以下任一命令向每个人授予完全访问权限:

  • cacls "$file_path" //E //P Everyone:F
  • icacls "$file_path" //grant Everyone:F

请注意ls -l使用cacls后,Msys中将不会显示真实ACL的准确信息或icacls .

关于mingw - Msys shell 命令更改文件的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10915178/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com