The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

• RT @EvaKestemont: Gezocht voor een vriendin met pech en een zware revalidatie: iemand die enkele maanden bij haar en haar lief en baby wil… 5 hours ago
• RT @steve_asbell: My therapist said “Why did you get an autism diagnosis? You’re more than a label!” I told him “I have ALWAYS been labele… 5 hours ago
• @Zangstem Ik duim dat je oud wordt. In goede gezondheid. 5 hours ago
• RT @JasonErvD: Weet je van die docenten die de cijfers van de hele klas voorlezen of projecteren op het digibord? Moet echt stoppen. Is ec… 5 hours ago
• RT @IanColdwater: I don't know why keynoting in front of 10,000 people feels less weird than this, but here we are 👩🏻‍💻 https://t.co/25ShsH… 9 hours ago

• Email Subscription

Join 1,821 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?