I know virtually none of you use OpenVMS, so what I'm asking for is some guidance for how to debug this on my own platform, in the interest of improving VMS support for everyone.

Here's a simple test:

jruby -e 'F=%[out.tmp]; File.delete F rescue nil; f=File.open(F,%[a]) ; $stdout=f; %w[eight four two].each{|_|puts _}'

On Linux and Windows, the output in out.tmp is:

eight
four
two

as expected. On OpenVMS it is:

\nwort

that is:

Dump of file DSA0:[DYMAX.001029]OUT.TMP;1 on 18-MAY-2011 09:57:59.21
File ID (458195,30,0)   End of file block 1 / Allocated 69

Virtual block number 1 (00000001), 512 (0200) bytes

00000000 00000000 00000000 00000000 00000000 00000000 00000074 726F770A .wort........................... 000000

What appears to be happening is every line is output at pos=0, and additionally, every newline at the end of a line is output at pos=0. I'm stumped. What could be causing this?

The real problem is "how do we patch (monkey-patch or otherwise) JRuby on OpenVMS to make up for the deficiency of the DCL shell on VMS that it does not support IO redirection via <, > and >>." We need to process ARGV, find redirection characters, consume those arguments, and do the desired redirection. Neither the approach above, nor using IO.redir work (both yield the same result). So if there is some other way to reach my goal that I have overlooked, please share.

(And for those of you who know a bit of VMS, before you suggest "just run it in GNV bash" or "use DCL PIPE", both of these have their downsides, which I will not get into right now.)

Curiously, if you change filemode "a" to "w", the problem vanishes. But in that case, the file is truncated, so we can't implement ">>" on top of this.

Ben
p.s. I have begun to merge VMS-related patches to the jruby-1_6 branch here:

https://github.com/bg/jruby-vms

So far, it just has the platform check, so we can implement other VMS-specific things as needed on top of this.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to