Page 1 of 1

[V2.beta.3] FileAppend does not work like documented

Posted: 04 Dec 2021, 04:47
by T-Rock
[Moderator's note: Topic moved from Bug Reports.]

The Help says about the second Parameter for using stdout for FileAppend:
However, text sent to stdout will not appear at the command prompt it was launched from. This can be worked around by 1) compiling the script with the Ahk2Exe ConsoleApp directive, or 2) piping a script's output to another command or program.
My guess is that it works like v1.
But using stdout ("*") as the second Parameter without changing the executable subsystem to Console mode the compiled program throws an error message in a message box saying "The handle is invalid".
test_sKL47QxxDN.png
test_sKL47QxxDN.png (5.09 KiB) Viewed 819 times

Re: [V2.beta.3] FileAppend does not work like documented

Posted: 08 Apr 2022, 22:05
by lexikos
That just means there is no stdout.
Such text can be redirected to a file, piped to another EXE, or captured by fancy text editors.
If you don't do one of those things, or set the stdout handle yourself, there will be no valid handle for FileAppend to write to.
An OSError is thrown on failure.