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?
CA Harvest SCM all versions and platforms
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)”
- “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.
If you decide to use option 1, 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.
If you decide 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 scm-broker -usr harvest -pw harvest -upd SampleRepository -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 -b scm-broker -usr harvest -pw harvest -rp \SampleRepository -bin -g -ext "TXT"