Kinook Software Forums

Kinook Software Forums (http://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (http://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   Replace in binary file problem (http://www.kinook.com/Forum/showthread.php?t=570)

savkin 09-15-2004 03:27 PM

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

kinook 09-15-2004 03:45 PM

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

savkin 09-15-2004 03:58 PM

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.


All times are GMT -5. The time now is 08:40 PM.


Copyright 1999-2019 Kinook Software, Inc.