What I understand from your explanation is that you have different branch permission on different branches. But to my knowledge, the branch permission setting is defined in iw.cfg file. So unless you are changing the branch permission settings explicitly after creating it, its always going to be the same as what you have defined in iw.cfg. In this case, you don't need to check permission and simply assign the same permissions to file. In fact, you can specify the default file permission in iw.cfg file.Thanks,Sumit
If you're on Solaris, and you want to make sure that the group that shares the branch is always the group owner of files and directories within that branch (even before the files get submitted) - use chmod g+s groupname on all the directories starting from the workarea directory -- do this from the command line at the beginning, and from that point on any new files or directories created within there will then inherit that group ownership (this is useful when you have a group-for-sharing which is not the user's primary group).