如何使用 Perforce 设置文件权限位 [英] How to set file permission bits with Perforce
问题描述
我注意到一些文件的其他位已关闭(例如,在签入 Perforce 时权限设置为 550).我希望每个人都可以阅读和/或执行它们.用'ls -l'的话来说,文件的权限是这样的:
I have a few files that I noticed have the Other bits turned off (e.g., permissions set to 550 when checked-in to Perforce). I want them to be readable and/or executable by everyone. To put it in 'ls -l' parlance, the file's permissions look like this:
签入:-r-xr-x---
签出:-rwxr-x---
Checked-in: -r-xr-x---
Checked-out: -rwxr-x---
我在执行 p4 edit 之前尝试设置 chmod 555,但 Perforce 只是将其重置为 750.同样,我在文件之后尝试了 chmod 755已打开进行编辑,但当我提交时,它恢复为 550.
I tried setting chmod 555 before doing p4 edit, but Perforce just resets it to 750. Likewise I tried chmod 755 after the file was opened for editing, but when I submit it reverts to 550.
我阅读了 p4 帮助文件类型
文档并没有看到任何答案,但我还是尝试了 +x 并且没有任何区别.
I read the p4 help filetypes
documentation and saw nothing that answered this, but I tried +x anyway and it didn't make any difference.
如何在 Perforce 中设置其他位?
How can I set the Other bits in Perforce?
推荐答案
Perforce 有两种设置文件权限的方法:
There are two ways to set file permissions in Perforce:
- 设置文件权限之前你
p4添加
文件到Perforce. - 使用您希望拥有的权限编辑文件,即:
- Set the file permissions before you
p4 add
the file to Perforce. - Edit the file with the permissions you would like to have i.e:
p4 edit -t text+x some_bash_script.sh
然后 Perforce 将使用您请求的文件类型打开文件进行编辑.本文档提供了有关 Perforce 文件类型选项的更多信息.
Then Perforce will open the file for edit using the filetype you requested. This document has more information on Perforce filetype options.
这篇关于如何使用 Perforce 设置文件权限位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!