---
title: "CC\t Type manager text_file_delta failed create_version operation"
author: "sujianchinaouya"
date: "2011-01-22T10:45:00Z"
tags: []
slug: "cc-type-manager-text-file-delta-failed-create-version-operation"
draft: false
lastmod: "2012-03-30T10:16:52Z"
id: 1469918
url: "https://sujian.iteye.com/blog/1469918"
---

**Problem(Abstract)** This technote provides a method to confirm the existence of a corrupt source container in an IBM® Rational® ClearCase® VOB based on a checkin error related to text files being referenced as a binary file along with steps to try and fix the container. **Symptom**

Attempts to complete a checkin results in the following error:

`Error checking in 'M:/View/VOB/dir1/dir2/foo.c' text_file_delta: Error: "foo.c" is not a 'text file': it contains a '/000'. This object's type does not support check-in of binary data.`

`Use a different type manager (such as compressed file). cleartool: Error: Type manager "text_file_delta" failed create_version operation. cleartool: Error: Unable to check in "foo.c".`

![](https://www-304.ibm.com/support/docview.wss?uid=swg21222072&aid=1) **Cause**

1. If this error arises the first time checking in a file (or during a file import process), the file likely has a file extension suffix the [cc.magic](http://www.ibm.com/support/docview.wss?rs=984&uid=swg21122471) file would consider a text\_file element type or the opening block of the file is in text but there are other parts of the file which contain binary data.
   
   To confirm whether a file contains a '/000' you can run the following test on the file using ccperl on Windows® or Perl on UNIX® or Linux®:
   
   Example:  
   `ccperl -e "print(@null=grep(//000/,<>)?'Contains nulls':'No nulls found')" "foo.c"`
2. There may be a corrupt source container. Check for indicators of a corrupt source container:

<!--THE END-->

- - Confirm that the file in question is in fact a text file.
    
    1. Copy the file to the operating system (outside of ClearCase) and open with a text editor.
    2. Ensure there are no binary characters in the file.
  - Attempt to change the element type using the `cleartool chtype` command and retry the checkin. If the same error occurs during checkin, there is a problem with the source container.
  
  **Note:** Some type manager errors on Windows are reported in the Windows Application Log (Source:ClearCase, Category:Debug). Therefore, when performing the checkin operation on Windows the error below will be displayed and the more detailed message as noted above will be reported in the Application Log.
  
  `cleartool: Error Type manager "text_file_delta". failed create_version operation. cleartool: Error: Unable to check in "testfile".`

**Resolving the problem** The solution for **Cause 1** has two different options. Choose the one that is right for your needs.

**OPTION 1**

Change the type manager of the file stored as text\_file to a different type manager and checkin in the file.

1. Run *cleartool chtype compressed\_file &lt;filename&gt;* while the file is still checked out from /main/0
   
   or
2. Remove the element (or rmname the element if this is a UCM environment).

**OPTION 2**

Manually remove the null characters in the file.

- **Linux and UNIX**

<!--THE END-->

- The following commands are examples of the kinds of methods which could be used to pull out the null characters in a file. They are not the only methods available.
  
  **Option #1**
  
  `perl -pi -e 's//x00//g' file_name`This command does a global replace on the null character and replaces it with nothing on the file specified.
  
  **Option #2**
  
  `awk '{gsub("/000","");print}' file_name > file_name`
  
  This command will also replace all the null characters with nothing.

<!--THE END-->

- **Windows**

<!--THE END-->

- 1. Open the file in a hex editor such as [XVI32](http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm) .  
     **Note:** XVI32 is a freeware hex editor.
  2. Click **Search &gt; Replace**
  3. Enter 00 (two zeros) in the find Hex field.
  4. Leave the replace field empty.
  5. Click **OK** and save as original file name.

You will now be able to check the file in.

如果是windows 的话可能是如下原因：

1. There may be a corrupt source container. Check for indicators of a corrupt source container:

Confirm that the file in question is in fact a text file.

1. Copy the file to the operating system (outside of ClearCase) and open with a text editor.
2. Ensure there are no binary characters in the file.

确保你的文件里没有二进制的文件。