View Single Post
  #7  
Old 08-08-2019, 15:32
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
Quote:
Originally Posted by elit View Post
Those " '|' (xtool) '|' " characters are pipes, that's how you pass data between programs and its is well known standard. Normally, you wouldn't never use '-'-' additionally in such case but I will try something like "cmd | xtool - - | cmd" later and let you know. Again v0.12 and ztool work fine like this.
Dude, I know that "|" is for pipe, but - - is for stdio in terms of xtool

The usage for xtool goes like this

xtool command input output
"-" denotes stdin/stdout depending where you put it.

This is how I have written it

Code:
  
if ParamArg[2] = '-' then
    Output := THandleStream.Create(GetStdHandle(STD_OUTPUT_HANDLE))
  else
    Output := TFileStream.Create(ParamArg[2], fmCreate);
Quote:
Originally Posted by elit View Post
Ok I can confirm that if I use "cmd | xtool precomp:zlib - - | cmd" then it work. Although '- -' should normally not be necessary in this type of syntax, at least it works. Thank you for a great tool.
The reason I have added it as "-"

is because what if you can accept input as stdin then the next program requires an existing file
it then becomes something like this

xtool command - output

or if input is a file and output is required as stdout
it becomes
xtool command input -

if pipes are involved it means stdin and stdout takes place which is why it is
xtool command - -

Last edited by Razor12911; 08-08-2019 at 15:35.
Reply With Quote