def create_lockfile(path):
    """ Create lockfile. """
    path = os.path.join(path, LOCKFILE)
    try:
        os.open(path, os.O_CREAT|os.O_EXCL|os.O_WRONLY, 0660)
    except __HOLE__, exc:
        print 'Cannot create lockfile:', exc
        sys.exit(1)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/scripts/repo.py/create_lockfile