|
From: | Dr . Jürgen Sauermann |
Subject: | Re: APL: GNU: How to output to a file? |
Date: | Mon, 20 Feb 2023 17:40:09 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
Hello Jurgen,
Yes, e.g.
E.g. the classical 2>&1 e.g.g:\cygwin32\bin\apl.exe --noSV -s -f c:/temp/helloworld.apl c:/temp/ddd.txt 2>&1
E.g. 2>
> g:\cygwin32\bin\apl.exe --noSV -s -f c:/temp/helloworld.apl 2> c:/temp/ddd.txt
Note: I have installed 10s of other programming languages lately, there e.g. 2>&1 basically always works to get the error output.But in apl.exe it never worked, whatever tried.
Thanks
On Monday, February 20, 2023 at 11:18:24 AM GMT+1, Dr. Jürgen Sauermann <mail@xn--jrgen-sauermann-zvb.de> wrote:
Hi Knud,
I see. Have you tried 2> instead of > ? If I remember correctly then at least older GNU
APL versions would use stderr (and not stdout) for all output, but I can't quite remember
when (and if) that was changed. The apl.exe files are usually somewhat older than those
in SVN, so maybe they suffer from that.
Best Regards,
Jürgen
On 2/20/23 12:45 AM, knud van eeden wrote:
Hello Jurgen,
I assume that this is only reproducible in Microsoft Windows.
If I try it with MSDOS cmd.exe and trying /cygdrive/c/temp/ it shows that it can not find that path.
G:\CYGWIN32\bin 20-Feb-23 0:42:11.35>apl.exe -f /cygdrive/c/temp/helloworld.apl > /cygdrive/c/temp/ddd.txtThe system cannot find the path specified.
G:\CYGWIN32\bin 20-Feb-23 0:42:16.93>apl.exe -f /cygdrive/c/temp/helloworld.apl >/cygdrive/c/temp/ddd.txtThe system cannot find the path specified.
G:\CYGWIN32\bin 20-Feb-23 0:42:20.63>apl.exe --LX /cygdrive/c/temp/helloworld.apl >/cygdrive/c/temp/ddd.txtThe system cannot find the path specified.
G:\CYGWIN32\bin 20-Feb-23 0:42:36.66>apl.exe --LX /cygdrive/c/temp/helloworld.apl >ddd.txt
G:\CYGWIN32\bin 20-Feb-23 0:42:45.58>dir ddd.txt
Directory of G:\CYGWIN32\bin
20-Feb-23 00:42 0 ddd.txt1 File(s) 0 bytes0 Dir(s) 520,593,293,312 bytes free
Thankswith friendly greetingsKnud van Eeden
On Sunday, February 19, 2023 at 02:37:19 PM GMT+1, Dr. Jürgen Sauermann <mail@xn--jrgen-sauermann-zvb.de> wrote:
Hi Knud,
I tried this, both on GNU/Linux and on cygwin in a VM running Windows XP (since I do not have a
native Windows machine) and running apl in a cygwin shell:
apl --LX '"Hello World" > /tmp/x
In both cases /tmp/x was created and contained the GNU APL startup banner and the "Hello World".
In my experience the Windows C: drive notation is not understood in all cygwin contexts,
maybe you should try /cygdrive/c instead of C: ?
Best Regards,
Jürgen
On 2/14/23 3:42 AM, knud van eeden wrote:
Hello Jurgen,
So looking again into this.
It is definitely a bug of apl on Microsoft Windows is my current opinion.
No output to a file is or can be generated.
Tried e.g.
g:\cygwin32\bin\apl.exe --noSV -f c:/temp/helloworld.apl >c:/temp/ddd.txt
g:\cygwin32\bin\apl.exe --noSV -s -f c:/temp/helloworld.apl >c:/temp/ddd.txt 2>&1
g:\cygwin32\bin\apl.exe --noSV -s -f c:/temp/helloworld.apl 2> c:/temp/ddd.txt
g:\cygwin32\bin\apl.exe --noSV -f c:/temp/helloworld.apl >c:/temp/ddd.txt 2>&1
...
Usually Cygwin programs running on Windows have the same behavior as on Linux, so thisis unexpected.
I am mainly interested in capturing the STDERR thus in order to debug errors.
This is e.g. the program used (helloworld.apl)
'Hello world'df -df ----)OFF
so the error thrown is
Hello worldVALUE ERRORdf-df----^
It is thus impossible to catch this error in a file.
===
Version of APL used:
c:\temp Tue 14-02-23 03:32:51>g:\cygwin32\bin\apl.exe --versionBUILDTAG:---------Project: GNU APLVersion / SVN: 1.7 / Unversioned directoryBuild Date: 2017-03-17 16:02:24 UTCBuild OS: CYGWIN_NT-5.1 1.7.27(0.271/5/3) i686config.status: unknown configure optionsArchive SVN:
===
As a next step: Is there maybe somewhere a latest pre-compiled binary executable version of Cygwin GNU APL.exe available somewhere?
Thankswith friendly greetingsKnud van Eeden
===
On Monday, August 29, 2022 at 11:25:36 AM GMT+2, Dr. Jürgen Sauermann <mail@xn--jrgen-sauermann-zvb.de> wrote:
Hi Knud,
GNU APL prints to stdout and stderr like all other "normal" programs.
It might be, though, that under non-normal operating such as WINDOWS
the output gets lost for some reason.
I suppose that the shell used (e.g. cmd.exe vs. the cygwin shell) might
make a difference in that respect. The following works just fine in GNU/Linux:
eedjsa@server68:~/apl-1.8$
eedjsa@server68:~/apl-1.8$
eedjsa@server68:~/apl-1.8$
eedjsa@server68:~/apl-1.8$ cat test.apl # prints ⍳10
⍳10
)OFF
eedjsa@server68:~/apl-1.8$ apl -s -f ./test.apl > test.output
eedjsa@server68:~/apl-1.8$ cat test.output
1 2 3 4 5 6 7 8 9 10
eedjsa@server68:~/apl-1.8$
eedjsa@server68:~/apl-1.8$
Best Regards,
Jürgen
On 8/28/22 8:47 PM, knud van eeden wrote:
Hello,
1. apl.exe has a parameter to input a file.
2. E.g.
apl.exe -f youraplfilenamehere
E.g.
apl.exe -f helloworld.apl
3. But how to get the output of it?
4. There seems to be no command line parameter to set output to a file (run e.g. apl.exe --help to see and check that).
5. Also something like pipe '>' to a file gives no results.
E.g.
apl.exe -f helloworld.apl >youroutputfilename
Can you please advise?
Thankswith friendly greetingsKnud van Eeden
[Prev in Thread] | Current Thread | [Next in Thread] |