bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: APL: GNU: How to output to a file?


From: knud van eeden
Subject: Re: APL: GNU: How to output to a file?
Date: Mon, 20 Feb 2023 16:55:47 +0000 (UTC)

> g:\cygwin32\bin\apl.exe --noSV -s -f c:/temp/helloworld.apl c:/temp/ddd.txt 2>&1

I assume those parameters like --noSV and -s cause some kind of intercept of the STDERR somehow.


On Monday, February 20, 2023 at 05:51:32 PM GMT+1, knud van eeden <knud_van_eeden@yahoo.com> wrote:


Hello Jurgen,

> GNU APL does nothing special on output; it uses the C++ cout and cerr channels.
Since this seems to work fine on all platforms except Windows, I would assume
that this is a Windows problem.

Very unlikely. This is an APL problem assumed.

E.g. installing all these other 20+ computer languages lately gave all no problems regarding getting the STDERR, 
with two exceptions MatLab and thus APL.

See also: Computer: Editor: Text: TSE: Language: Computer: All: How to compile many computer languages from within TSE? Link: Can you give an overview of links?



On Monday, February 20, 2023 at 05:40:14 PM GMT+1, Dr. Jürgen Sauermann <mail@xn--jrgen-sauermann-zvb.de> wrote:


Hi Knud,

sorry to hear that. Unfortunately I have no more ideas what may be wrong.
However, I never tried to run GNU APL directly from the Windows command line.
I always used the cygwin console.

GNU APL does nothing special on output; it uses the C++ cout and cerr channels.
Since this seems to work fine on all platforms except Windows, I would assume
that this is a Windows problem.

Best Regads,
Jürgen



On 2/20/23 3:49 PM, knud van eeden wrote:
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.txt
The 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.txt
The 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.txt
The 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.txt
               1 File(s)              0 bytes
               0 Dir(s)  520,593,293,312 bytes free

Thanks
with friendly greetings
Knud 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 this
is 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 world
VALUE ERROR
      df-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 --version
BUILDTAG:
---------
    Project:        GNU APL
    Version / SVN:  1.7 / Unversioned directory
    Build Date:     2017-03-17 16:02:24 UTC
    Build OS:       CYGWIN_NT-5.1 1.7.27(0.271/5/3) i686
    config.status:  unknown configure options
   Archive SVN:

===

As a next step: Is there maybe somewhere a latest pre-compiled binary executable version of Cygwin GNU APL.exe available somewhere?

Thanks
with friendly greetings
Knud 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?

Thanks
with friendly greetings
Knud van Eeden








reply via email to

[Prev in Thread] Current Thread [Next in Thread]