I just verified nothing has changed in Unix/Darwin from j504
through current j602. But was amused to notice that wc is
different in Red Hat Linux 8.0 3.2-7 and Darwin and Fedora.
Here are the results of wc on a file "a." (which is just j a.)
in those three systems respectively -
[EMAIL PROTECTED] jkt]$ wc a. # Red Hat Linux 8.0 3.2-7
1 1 256 a.
iMg5:~/Desktop jkt$ wc a. # Darwin
1 3 256 a.
[EMAIL PROTECTED] ~]$ wc a. # Red Hat 4.1.2-13 (Fedora)
wc: a.:2: Invalid or incomplete multibyte or wide character
1 1 256 a.
I guess/think the last one is progress towards more alphabets.
Perhaps it is equally "funny" that Red Hat (old and new) don't
"see" the blank in a. to report 2 "words" but also strange that
Darwin reports 3 words... Even adding a linefeed to the end -
echo '' | cat a. - > a.lf
doesn't change the count of words (but does get 2 lines) in each
system:
[EMAIL PROTECTED] jkt]$ wc a.lf # Red Hat Linux 8.0 3.2-7
2 1 257 a.lf
iMg5:~/Desktop jkt$ wc a.lf # Darwin
2 3 257 a.lf
[EMAIL PROTECTED] ~]$ wc a.lf
wc: a.lf:2: Invalid or incomplete multibyte or wide character
2 1 257 a.lf
I think this shows the general attitude of the "computing
community" as regards edge conditions...
I'm happy with the way j stdin/out works in these environments.
(and I realize you only asked Window folk to look at the change... :)
- joey
At 08:22 -0500 2007/11/12, Eric Iverson wrote:
Just noticed that a change for setmode binary was made to the code
some time ago and should have effect in the 602 beta. Haven't looked
at the details of the change but it was the result of the
discussions back when this issue was first raised.
Please take a look and see if the change works as desired.
please take a look and report problems.
----- Original Message ----- From: "Oleg Kobchenko" <[EMAIL PROTECTED]>
To: "Beta forum" <[email protected]>
Sent: Saturday, November 10, 2007 9:13 PM
Subject: Re: [Jbeta] Stdout write in binary mode for windows
To be specific, concerning what stream numbers to use:
I suggest changing existing 4 for binary output and not
adding new numbers (6 and 7):
- or it will require same added to Unix versions for
consistency
- or will make J and user code more complicated
- there aren't many (if any at all) uses of 1!:2&4 at least
for Windows, and it will be easy to fix
- this will be used for true binary output such as
images or precise text
- 1!:2&4 is unlikely to require CRLF ever and
easy to compensate
So it's easier and CR will never be missed.
There is no need to change stderr (1!:2&5), because it's
always for text output and not binary, so CRLF is OK.
If anybody thinks otherwise, please comment.
--- Eric Iverson <[EMAIL PROTECTED]> wrote:
With luck the change in windows j602 jconsole to use binary stdio will be in
the c or d beta.
----- Original Message ----- From: "Oleg Kobchenko" <[EMAIL PROTECTED]>
To: "Beta forum" <[email protected]>
Sent: Thursday, November 08, 2007 12:43 PM
Subject: [Jbeta] Stdout write in binary mode for windows
Is there anything in j602 related to
binary stdout/stderr?
http://www.jsoftware.com/pipermail/beta/2007-January/002148.html
--------------------------------------------------------------------------------
[Jbeta] Stdout write in binary mode for windows
Eric Iverson eiverson at sympatico.ca
Fri Jan 5 23:12:05 HKT 2007
I will take a look at this. It is a good suggestion and something will
be done unless there are unforseen problems.
Are there compatibility issues with old uses?
What about 5 for stderr.
It might be easier (and take less analysis) to simply add 6 and 7 for
binary versions of 4 and 5.
Joey and other console users: any comments on this?
----- Original Message ----- > From: "Oleg Kobchenko" <olegykj
at yahoo.com>
To: "Beta forum" <beta at jsoftware.com>
Sent: Thursday, January 04, 2007 6:41 PM
> Subject: [Jbeta] Stdout write in binary mode for windows
Now there is no way to emit binary data
using stdout. For example, this is important
for CGI binary output, such as images;
or if J is used as a slave process to return
binary data through the pipe, like task.
Is it possible in the upcoming release to
change the implementation of 1!:2&4
so that it uses binary mode instead of text mode?
If somebody needs to output CRLF in text for windows
it easy to do in J before calling the function
>> or use "echo" (1!:2&2) which could remain in text mode.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm