Operating System - OpenVMS
1828625 Members
1764 Online
109983 Solutions
New Discussion

filename globbing, IO redirection, etc.

 
SOLVED
Go to solution
Ben Armstrong
Regular Advisor

filename globbing, IO redirection, etc.

Buoyed by the phenomenal success of my other inquiry[0] I am now ready to tackle my next problem with the OpenVMS port of Ruby.

In DCL, filename globbing and IO redirection don't exist (and please don't point me at "HELP PIPE"; it is not a full implementation of Unix IO redirection, notably lacking "append") so scripting languages like Ruby that depend on the shell supporting this behaviour cannot be used to their full potential. When we ran up against this problem, we decided we'd look at what OpenVMS Perl does. Lo and behold, Perl does have support for this and a number of other tweaks in a file simply called "vms.c".[1]

So we borrowed bits of this code and put them in Ruby. Mind you, our initial version still has some bugs, but the transplant was, on the whole, successful.

My question is: if many different porters have to do this work over and over again, why isn't there a library supporting these "missing" operations? (I haven't looked yet to see what OpenVMS Python does -- would be interesting to compare notes.) Indeed, why doesn't the Porting Library package cover this? Seems like a logical thing to add.

Ben
[0] http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=879611
[1] http://public.activestate.com/gsar/APC/perl-current/vms/vms.c
I guess Craig "no relation to Chuck" Berry knows a little bit about this file. :)
2 REPLIES 2
Craig A Berry
Honored Contributor
Solution

Re: filename globbing, IO redirection, etc.

Ben,

I'm glad you are finding Perl's getredirection() and globbing routines useful. I did not write them, though I've patched them a bit over the years. In fact I don't think they were even written for Perl originally, so you're borrowing from something that's already borrowed.

It does seem odd that the CRTL never offered this type of support. Ten years ago it was probably considered something that belonged with the now-defunct POSIX facility, and in recent years it's probably been considered something that should be handled by PIPE or perhaps GNV. In fact it's possible that the bash shell in GNV does handle redirection and globbing, though I haven't experimented with that. As Brad mentioned in the other thread, there is a product manager ready and waiting to hear the business case for putting these features in the CRTL.

An open source development that may eventually help the situation somewhat is the Parrot engine, which is destined to be the VM underneath Perl 6 and some future version of Python, and possibly Ruby as well. If this sort of thing becomes part of the VM, then the individual language implementations will be able to share it.
Ben Armstrong
Regular Advisor

Re: filename globbing, IO redirection, etc.

Craig,

Yes, I realize that it was borrowed already, and had the same idea to try to interest the GNV folks in the problem a while back[0], but was unable to get a response. This may have been due to bad timing, not focusing the post the right way, or simply not posting to the right forum. I posted this "OT" post to gnv-help which may not have been appropriate. There is a gnv-develop list too, but it seemed dormant, so I took my chances with gnv-help.

One of our team members here tried GNV's bash a while back and it had problems that the team judged at that time to make it unsuitable as a wrapper for Ruby. The details are fuzzy in his memory, so I'll have to look over the project document to see if they were properly recorded, but it doesn't sound encouraging.

I will have to talk to the product manager about this and the select() issue as you and Brad suggested. But I'm not holding my breath for a quick solution through that channel.

The Parrot engine does sound intriguing, too. Though again, it doesn't sound like it will be delivered in a timely enough fashion to help us out with our immediate problems. So we may end up having to kludge our way around it in the meantime. But knowledge that this is on the horizon might change our approach today in favour of a made-for-Ruby workaround until Parrot is delivered.

Ben
[0] http://sourceforge.net/mailarchive/message.php?msg_id=11179221