|
#1
|
|||
|
|||
Replace in binary file problem
It looks like I've found a bug in Visual Build 5.2 - 5.5 versions.
I'm using "Replace in File" step to serach and replace a text string in a binary file (for example notepad.exe from WINNT folder). If string exists Visual Build erases entire file, so after this step file's size is only 8 bytes. Version 4.6b worked fine with binary files. Is there a way to fix it or any workaround? Thanks, Slava |
#2
|
|||
|
|||
It's not a bug, as the Replace in File action is only intended for replacing text in text files. If it ever did work for binary files it was only incidental. Most likely the reason it no longer works is that VBP (as of 5.0) is a Unicode app, and the file contents are converted from the specified code page / encoding to Unicode, processed internally as a Unicode string, and converted back to the specified code page when writing the changes back out. This is necessary to properly support Unicode, but obviously won't work for non-text files.
We'll consider adding support for binary file search and replacement in a future release. For now, you can use a tool such as XVI [1] that is designed to support replacements in binary files and provides a command-line interface for automating it. [1] http://www.chmaas.handshake.de/delph...vi32/xvi32.htm |
#3
|
|||
|
|||
Thanks for the quick reply!
It would be so nice if you added binary files support in a future release. It's really necessary. Until then I'll have to use an external utility for this purpose. |
|
|