NAME

ccfd - a ClearCase-aware shell program for Unix


SYNOPSIS

    % ccfd cp foo bar
    % ccfd -- cp foo bar
    % ccfd -c "cp foo bar"
    % ccfd
    ccfd% cp foo bar
    % ccfd -m -i -x -- cp foo bar
    % ccfd -mi -- make install


DESCRIPTION

CCFD stands for ClearCase for Dummies. No slight is intended to any human; the reference is to programs which are ``dumb'' in the sense that they don't understand ClearCase. It consists of a program called ccfd and some supporting libraries; in the following, the uppercase acronym CCFD is used to refer to the entire application while ccfd refers to the program.

What CCFD does is inject ``ClearCase awareness'' into any program run under its control (including its children, grandchildren, etc.). The simplest manifestation of this is just-in-time checkouts. For instance, here's an element in a dynamic view:

    % ct ls -s foo   
    foo@@/main/1

ClearCase represents elements as read-only files within a read-only file system:

    % ls -l foo 
    -r--r--r--   1 dsb      ccusers     1880 Mar 22 08:02 foo

So any attempt to modify it without a checkout will of course fail:

    % date > foo
    Error: foo: cannot create

but with CCFD enabled:

    % ccfd                      <-- starts a new shell process
    ccfd% date > foo
    Checked out "/vobs_ccfd/t/foo" from version "/main/1".
    ccfd% ct ls -s foo
    foo@@/main/CHECKEDOUT
    ccfd% cat foo
    Tue Mar 26 09:41:21 2002

the checkout is done on the fly and the command succeeds.

CCFD can also be told to automatically checkin its checkouts, to create new files as elements, to start views on demand, etc. as described in OPTIONS. The default behavior is checkout-on-demand-and-leave-checked-out only, as demonstrated above.

Another way to think of CCFD is that it implements the hijack feature of snapshot views for dynamic views, though of course elements hijacked by CCFD don't need to be converted to checkouts later because they're already checkouts.

CCFD has no effect on flat files, devices, snapshot views, or view-private files within dynamic views.


OPTIONS

The comment provided for automatic operations may be set via the CCFD_COMMENT environment variable. No flag is provided for this.


USAGE NOTES


HOW IT WORKS

The idea is quite simple: CCFD ``wraps'' file-access system calls such as open(). For instance, checkout-on-demand is handled like this: the wrapper around open(2) invokes the real system call first. If that succeeds, and in the majority of failure cases as well, the result is allowed to stand and the return code passed back to the caller. In one very specific situation (the open failed, it was attempting to write, the file it failed to write existed previously, the path is within a VOB, and a few other tests), the wrapper checks out the file and retries the open. This 2nd result is always passed back to the caller.

Other system calls such as mkdir(), stat(), chmod() etc. are translated to their ClearCase equivalents in a similar manner.


CAVEATS, LIMITATIONS, KNOWN BUGS

Though a few known bugs are listed below, and the usual set of unknown ones presumably exist, comfort may be found in this fact about ClearCase: There are only a few irreversible operations on VOB objects: rmelem, rmtype, and rmver. As CCFD contains no code to do any of those things, it is absolutely impossible for it to destroy ClearCase data. The worst that could happen, if something went badly wrong, would be a mess that would take some laborious admin work to clean up (such as linking elements back into directories). And even this could happen only with the auto-checkin flag (-i) set; without that the prior state can always be restored by unco-ing everything and perhaps cleaning up lost+found.

Note that the above applies to ClearCase data; it's not impossible for CCFD to remove view-private data irretrievably. I don't think it does but no promises are made, no warrantee express or implied exists, etc. Critical view-private files, as always, should be backed up or made into versioned elements.


SEE ALSO

    ld.so.1(1) on Solaris or ld.so(1) on Linux
    crle(1) on Solaris
    All ClearCase Documentation


AUTHOR

David Boyce dsb@boyski.com


COPYRIGHT

Copyright (c) 2002-2005 David Boyce, Clear Guidance Consulting. All rights reserved.


THANKS

CCFD was inspired by the suggestion of Christian Goetze, who wondered aloud on CCIUG why ClearCase didn't have auto-checkout capabilities like Continuus.