Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Native java implementation of decc$translate_vms?

 
Ben Armstrong
Regular Advisor

Native java implementation of decc$translate_vms?

I'm working on adding more support for VMS to JRuby, starting with the work by Phillipe Vouters and Thierry Uso at http://vmsfree.ouvaton.org/freen/index.php?s=jruby, merging their patches one at a time and submitting them upstream so they will be included in subsequent releases. So far, I have submitted (and they have accepted) just the one simple patch for the IS_OPENVMS platform check:

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

I will include more patches from Messrs. Uso and Vouters (e.g. FFI) in time, but before I do that, there are some issues with core components of JRuby that are important to address.

While Java on VMS does automatic filepath translation, we need some ability to translate between VMS and Unix-style filepaths that is under program control in Java, otherwise JRuby misparses them, e.g. by attempting to expand what it thinks is a relative path, ending up with a mishmash of Unix-style plus VMS-style filepaths:

"JAVA$FILENAME_CONTROLS" = "-1"

$ jruby disk:[dir]file.rb
Error opening script file: /DSA0/BG/disk:[dir]file.rb (no such file or directory (errno:2))

I cannot imagine upstream would accept a call into DECC to use decc$translate_vms from a core component such as src/org/jruby/util/JRubyFile.java. External modules like FFI, sure, but the core should be self-contained. Therefore, it seems to instrument JRubyFile.java with path translation, I need a native Java implementation of decc$translate_vms. Does one exist already that I have overlooked?

Ben

1 REPLY 1
Ph Vouters
Valued Contributor

Re: Native java implementation of decc$translate_vms?

Dear Ben,

 

As already email stated there is no need for the decc$translate_xxx C RTL source code access. This source code is very likely to make VMS specific calls you won't be able to turn to pure Java so that it can be accepted by the JRuby maintainers for inclusion into the JRuby source stream.

 

Download the corresponding latest  pure Java zipped source code from http://vouters.dyndns.org/zip/DeccTranslateName.java.zip Refer to http://vouters.dyndns.org/tima/OpenVMS-Java-Unix-CRTL_API_decc$translate_name-Java_solution.html for the conditions under which this code has been written and tested.

 

This article includes various tested VMS style file specifications syntaxes along with the corresponding Unix style file specification syntaxes result the code produced. You will note you should not need any DECC$EFS_CHARSET logical enabled. This is unlike the C RTL decc$transate_vms routine as per stated at http://vouters.dyndns.org/tima/OpenVMS-Intel-Itanium-Assembler-Some_notes.html

 

However if you pay enough attention to the comments in the tests part, you'll notice that JAVA$FILENAME_CONTROLS logical may interact with this Java code.

 

Yours sincerely,

Philippe