Convert storage type from Text to Binary
search cancel

Convert storage type from Text to Binary

book

Article ID: 97916

calendar_today

Updated On:

Products

CA Harvest Software Change Manager - OpenMake Meister CA Harvest Software Change Manager

Issue/Introduction

We have a Harvest project that uses files with a "TXT" extension, that contain unicode characters.  We would like to have Harvest treat these files as binary files instead of Text to avoid the limitations on files that Harvest wants to treat as text files.  How can this be done?
 

Environment

CA Harvest SCM all versions and platforms

Resolution

To accomplish this you should make sure the File Extensions setting for your repository is either set to: 

- “Do Not use any extension (All files are treated as binary)” 

or 

- “Use Repository text file extensions” 

To explain these settings 

  1. If you have selected the “Do Not use any extension (All files are treated as binary)” radio button, then all files checked in will be treated as binary, no matter what file extension they have. 
  2. If you have selected the “Use Global text file extensions”, then Harvest will use a pre-set list of file extensions to decide whether to check in a file as binary or text. 
  3. If you have selected the “Use Repository text file extensions”, then Harvest will use a list of file extensions you provide to decide whether to check in a file as binary or text. 

To resolve this problem you will need to do 2 things: 

  1. Change the File Extension option for your repository in the Administrator Tool (or using the “hrepmngr” command line utility) to NOT use the global text file extensions list. This will specify that, going forward, any new files checked in will follow the new rule you have selected. 
  2. Use the “hchgtype” command line utility to convert any existing files in the repository that use the wrong storage type so that now they use the correct one. 

Step 1: Change the File Extensions option for this repository: 

In your case, for this repository you have chosen either option 2 or option 3. What you should decide is whether to use option 1 to treat all files as binary, or option 3, to provide your own list of file extensions to use. 

To use option 1, log in the Administrator Tool, right click on the repository name, select "Properties", and then go to the File Extensions tab. Select the first radio button “Do Not use any extensions…” and click OK. 

To use option 3, it will be easier to accomplish this change by using the “hrepmngr” command line utility, since in the Administrator Tool you would have to click “Add” and type in each file extension separately to build your list. Here is an example hrepmngr that creates a custom list of file extensions for the selected repository: 

hrepmngr -b <brokername> -prompt -upd <repository name> -rext -addext "ALX" "ASP" "AWK" "BAS" "BAT" "C" "CLASSPATH" "COB" "COBOL" "CPP" "CSH" "CSS" "CXX" "DSM" "DTD" "H" "HPP" "HTM" "HTML" "HTX" "HXX" "INI" "INL" "JAVA" "JS" "JSP" "KSH" "MAK" "MAKE" "PERL" "PROJECT" "PROPERTIES" "RC" "SH" "SHELL" "SHTML" "SQL" "STM" "TEMPLATE" "TLH" "TLI" "TXT" "XML" "XSL" 

Step 2: Change the storage type for any existing files in the repository that are stored incorrectly. 

You can either do this in Workbench by right clicking the top folder level in the repository and selecting “Change Storage Type” -> “Binary” 

If you would prefer to use the “hchgtype” command line utility, here is an example command that would work: 

hchgtype TXT -b <brokernme> -prompt -rp \<repository folder name> -bin -g -ext

If you want to convert all text files to binary in the repository you will need to include all the "text-type" file extensions.  Here's an example:

hchgtype ALX HXX STM ASP COB CXX H JAVA JS PERL PROPERTIES RC TLI XML CLASSPATH PROJECT BAT COBOL DTD HTX INI KSH SHTML CSH DSM INL JSP SHELL SQL TXT BAS C HPP HTM MAK MAKE SH TEMPLATE CSS HTML TLH XSL AWK CPP -b  <brokername> -prompt -rp \<repository folder name> -bin -g -ext