clearcaseclearcase-ucmclearcase-remote-client

ClearCase: files with the same oid in diferent directories


I encountered something that has me stumped.

We have several files that are identical in every respect (including their oid - so they're certainly not evil twins) but are located in two different directories. Looking at the element properties, they both contain the same pathname, but they can also be found in a second directory.

My first thought was that they (or one of their parent directories) must have a symlink between them. I used the following command in the root of the VOB to find them:

cleartool find . -kind slink -print

However, it returns no results.

Anyone know what's going on here?


Solution

  • Since in ClearCase the folders are in charge of recording the listing of their elements, do describe the parent folders of that duplicated files.

    It is possible for two different folders to record the same file.

    More precisely, check for an hardlink (not just a soft link 'slink')

    A hardlink is an additional entry in a directory for an existing file.
    Only one copy of the file exists on the harddisk. If you modify any copy, you modify all other copies. ClearCase does this at directory structure through the same inode and increases the reference count by 1.

    Note that, when you use find -all, only one instance of an element is reported, even if one or more VOB hard links point to the element. Either the element name or one of the VOB hard links is displayed.

    See more at "Identifying hard links within a VOB".

    use cleartool find executed as follows from the root of the VOB:

    cleartool find -all -exec 'cleartool describe -fmt "%[aliases]ACQp\n" $CLEARCASE_XPN'
    

    This output will provide for you a list of all the elements in the VOB, and if a given element has more than one hardlink, the other hard link will be displayed after a comma in the list.
    The output will look similar to the following:

    "/vobs/TestVOB1@@/main/dir1/7/1.txt", "/vobs/TestVOB1@@/main/dir1/7/1.foo.txt"
    

    Finally, the following command will provide you only the elements with hard links:

    cleartool find -all -exec 'cleartool describe -fmt "%[aliases]ACQp\n" $CLEARCASE_XPN' | grep ","