如何使用 Cygwin 中的 cp.exe 并保留权限

发布于 2024-12-19 23:26:40 字数 1459 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云仙小弟 2024-12-26 23:26:40

我相信将选项 noacl 添加到 /etc/fstab 中的 /cygdrive 挂载点将满足您的需求。

$ cat fstab
# For a description of the file format, see the Users Guide   
# http://cygwin.com/cygwin-ug-net/using.html#mount-table

# This is default anyway:
# none /cygdrive cygdrive binary,posix=0,user 0 0
none /cygdrive cygdrive binary,posix=0,user,noacl 0 0

请参阅http://cygwin.com/cygwin-ug-net/using。 html#mount-table讨论 来自cygwin 邮件列表。

I believe adding option noacl to the /cygdrive mount point in /etc/fstab will do what you want.

$ cat fstab
# For a description of the file format, see the Users Guide   
# http://cygwin.com/cygwin-ug-net/using.html#mount-table

# This is default anyway:
# none /cygdrive cygdrive binary,posix=0,user 0 0
none /cygdrive cygdrive binary,posix=0,user,noacl 0 0

See http://cygwin.com/cygwin-ug-net/using.html#mount-table and discussion from the cygwin mailing list.

埖埖迣鎅 2024-12-26 23:26:40

在提出上述问题后,我对此做了更多调查。

根据与 Cygwin 开发人员之一的此讨论,Cygwin 似乎并没有不关心 Windows 权限,只使用 POSIX 权限。

据我所知,POSIX 权限与 Windows 权限是完全不同的,所以是的,它们受到支持真是太好了,但最终,Cygwin 无法复制文件并维护正常的 Windows 权限。让它对我来说毫无用处。使用 Python 或 Ruby 更好。

但我很乐意被证明是错误的。

I did some more investigation about this after asking the question above.

Per this discussion with one of Cygwin's developers, it appears that Cygwin doesn't care about Windows permissions, and just sticks with the POSIX ones.

From what I can tell, POSIX permissions are a whole separate thing from the Windows ones, so yes, it's great that they're supported, but ultimately, Cygwin can't copy files and maintain normal Windows permissions. Making it useless to me. Much better to use Python or Ruby.

I would love to be proven wrong though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文