def remove(patch, path):
    """
	Remove (delete) the file path.
	If path is a directory, OSError is raised; see rmdir() below to remove
	a directory.
	This is identical to the unlink() function documented below.
	On Windows, attempting to remove a file that is in use causes an
	exception to be raised; on Unix, the directory entry is removed but the
	storage allocated to the file is not made available until the original
	file is no longer in use.
	"""
    ap = os.path.abspath(os.path.join(CWD, path))
    manager = get_manager()
    fsi, relpath, readonly = manager.get_fsi(ap)
    if fsi is None:
        return _org_remove(relpath)
    elif readonly:
        raise IOError("[Errno 1] Operation not permitted: '{p}'".format(p=ap))
    else:
        # FSI.remove() works on both files and dirs, we need to check
        # this before and raise an Exception if required
        if os.path.isdir(relpath):
            raise os.error("OSError: [Errno 21] Is a directory: '{p}'".format(p=ap))
        try:
            return fsi.remove(relpath)
        except OperationFailure as e:
            raise os.error(e.message)

	Remove (delete) the file path.
	If path is a directory, OSError is raised; see rmdir() below to remove
	a directory.
	This is identical to the unlink() function documented below.
	On Windows, attempting to remove a file that is in use causes an
	exception to be raised; on Unix, the directory entry is removed but the
	storage allocated to the file is not made available until the original
	file is no longer in use.
	
lib/mlpatches/mount_base.py