# The Wiert Corner – irregular stream of stuff

• ## Email Subscription

Join 2,161 other followers

## InplaceExeWrapper for those tools that do not allow specifying an output file – twm’s blog

Posted by jpluimers on 2019/12/17

In my bin directory from [WayBack] InplaceExeWrapper Project Top Page – OSDN: [WayBackInplaceExeWrapper for those tools that do not allow specifying an output file – twm’s blog:

There are a lot of command line tools that are very useful, but have one flaw: They directly modify a file in place and do not allow you to specify an output file instead.

Enter InplaceExeWrapper which called as

InplaceExeWrapper --expectfilenameonstdout c:\path\to\dprojnormalizercmd.exe input.dproj output.dproj

does the following:

1. Create a temporary directory under %TEMP%
2. Copy the input file input.dproj there
3. Call the tool as dprojnormalizer tempfile.dproj
4. Copy the modified file to the output file output.dproj
5. Delete the temporary directory

So basically it replaces the missing functionality of specifying an output file for the tool it calls.

Here is the full help on command line parameters and options:

Synopsis: InplaceExeWrapper [options] Executable InFile [OutFile]

Parameters:
Executable        : Executable to call (if set to "copy" we only copy InFile to OutFile)
InFile            : input filename
OutFile           : output filename, defaults to infile

Options:
--CheckResult=value : If set, the executable must return the value given for this option (must be a number)
--debug           : if given, some debug output is written to error.txt in the temp directory and the temp directory will not be deleted.
--ExpectFilenameOnStdout : if set, the output of the executable must contain the filename
--help
-?
-h
-H                : display parameter help
--ShowCmdLine     : Show command line as passed to the program.
--StartupLog=value : Write a startup log to the given file.
--TempDir=value   : directory to use for temporary files (must exist)
--toStdOut        : if set, output is written to stdout and infile is not changed

–jeroen

1. ### Anna Kristensensaid

Another useful feature is comparing two snapshots. For example, a developer realizes that a process constantly consumes memory and does not give it back, or the number of GDI objects increases and increases. One could just get a snapshot and explore it, but it is much more convenient to get the first (base) snapshot, then give the process some time to allocate new resources. Finally get a new snapshot and look at its difference with the base snapshot. Thus, the difference between snapshots allows to see new allocations, and of great importance is the number of Hit Count that indicates that they are allocated at the same place in the code.

But how is that related to InplaceExeWrapper?