Phil for Humanity
A Guide for the Survival of Humankind and Helping the World, Society, and Yourself.



ClearCase Support: Changing File Permissions


I am often asked how to change file permissions on elements in ClearCase, so here are some simple examples on how to do it.

For instance, let's assume you have a ClearCase element with these permissions:

-r-x------ 1 user1 group2 76 Mar 16 02:25 filename.txt

Run this command to change the element's permissions. This is equivalent to UNIX's "chmod" command:

$ cleartool protect -chmod 755 filename.txt

This will result with an element with these permissions:

-rwxr-xr-x 1 user1 group2 76 Mar 16 02:25 filename.txt

To recursively change permissions for an entire directory (for this example, the /vob/test directory) and all sub-files and sub-directories in that directory, you can run:

$ cleartool protect -chmod 775 -r /vob/test

Now, let's say you want to change the element's owner and group. This is equivalent to UNIX's "chgrp" and "chown" commands:

$ cleartool protect -chgrp newgroup -chown newuser filename.txt

This will result with an element with these permissions:

-rwxr-xr-x 1 newuser newgroup 76 Mar 16 02:25 filename.txt


by Phil B.

Related Articles
 » ClearCase Support: Checked Out But Removed Error
 » ClearCase Support: How to Find Checked Out Elements
 » ClearCase Support: Creating Elements