PRB: Binary Files with Keyword Expansion Corrupted

Last reviewed: September 11, 1997
Article ID: Q155888
The information in this article applies to:
  • Microsoft Visual SourceSafe, 16-bit and 32-bit, for Windows, versions 4.0, 4.0a, 5.0

SYMPTOMS

If Keyword Expansion is enabled for binary files, and a binary file containing a SourceSafe Keyword is checked in, that file will be corrupted.

RESOLUTION

  1. Use Keyword Expansion in Binary Files.

Use two colons in the keyword, for example:

$Revision::     $

NOTE: Make sure you leave enough space between the second colon and the dollar sign for the revision number.

When you use one colon, SourceSafe puts its information between the colon and the dollar. Depending on how long the information is, and how many spaces you had, this will generally make the whole string either shorter or longer than it was at first. In a text file, this is no problem, but it will corrupt a binary file.

When you use two colons, that tells SourceSafe to keep the string length the same. In other words, SourceSafe knows to keep the exact same number of characters between the second colon and the dollar sign. SourceSafe will pad with extra spaces, or truncate the information, as necessary, in order to keep things the same, so the binary file is not corrupted.

  1. Disable keyword expansion in binary files using one of the following methods:

    a. Add the case-sensitive keyword $NoKeywords: $ before adding any other

          keywords. This prevents Visual SourceSafe from expanding subsequent
          keywords.
    

-or-

   b. Remove *.xls from the "Expand keywords in files of type" textbox.

-or-

   c. Add !*.xls to the "Expand keywords in files of type" textbox.

Items "a." and "b." listed above are both equivalent to editing the Keyword_Masks variable manually in the SRCSAFE.INI file.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Problem

  1. In the Visual SourceSafe Administrator, go to the Tools menu and click Options, and then click the General tab in the Options dialog box. Add *.xls in the "Expand keywords in files of type" textbox.

  2. Open a new Workbook in Excel and enter "Hello World" in Cell A1. Save the file.

  3. Add the file to a Visual SourceSafe project and then check out the file.

  4. Open the file in Excel. Enter "$History: $" in Cell A2.

  5. Save the file and check it into Visual SourceSafe.

If the "Copy keyword-expanded files into working directory" check box is selected (it is located on the Local Files tab in the Options dialog box) in the Visual SourceSafe client, Excel will hang immediately. If the check box is not selected, Excel will hang the next time that file is opened by checking it out and opening it, or by performing a Get on the file.

REFERENCES

For more information on Keyword Expansion, see Chapter 5 in the Visual SourceSafe User's Guide.


Additional query words: DLL EXE DOC
Keywords : ssafe ssusage
Version : WINDOWS NT:4.0,4.0a,5.0;
Platform : NT WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.