How to add write permission (+w) recursive?

Viewed 30

I need to change filetype to add write permission (+w) to a lot of files under a root folder. I found the following command to remove +w; somebody knows how to change it to add +w instead of remove it?

Thanks in advance

p4 -F "%type%@%depotFile%" files ... | grep -e ".*w.*@.*" | sed -e "s/\(.*\)w\(.*\)@\(.*\)/edit -t \1\2 \"\3\"/" | p4 -x - run
1 Answers

No need for fancy grep/sed shenanigans when you're adding a modifier, since you can specify it directly to p4 edit -t:

p4 edit -t +w ...

Note that there's a reason the writable bit isn't set by default on files under Perforce control -- it makes it really easy to lose work by forgetting to open files for edit! I usually recommend only doing this for generated files where the cost of forgetting to check them in is low relative to the minor annoyance of having to remember to open them for edit before you compile.

Related