Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

All versions of VMS files

by Njall (Acolyte)
on May 11, 2005 at 15:54 UTC ( #456048=perlquestion: print w/ replies, xml ) Need Help??
Njall has asked for the wisdom of the Perl Monks concerning the following question:

Greetings,

Heretofore I have used readdir() almost exclusively to walk directories. And until I started using Perl 5.6.1. on VMS recently that was delightfully more than adequate. However, I am applying Perl to a data analysis problem on one of our (it ain't open) VMS systems. And I need to see all of the files in a directory not just the highest versions of the files.

Alas readdir() can't handle that request. However, globbing, as in

while (<*.*;*>) { my $file = $_; print "$file \n"; # or whatever. }
does pick up all versions.

Question: Aside from this technique using globing, can someone recommend a better way of getting a list of all versions of files under VMS?

- Njall

Comment on All versions of VMS files
Download Code
Re: All versions of VMS files
by Tanktalus (Canon) on May 11, 2005 at 16:44 UTC

    Taking a quick-ish scan of the File::Glob module, I'd say, no. It seems that File::Glob uses XS code to do the actual reading of the filesystem, which likely means that the author couldn't find a pure-perl way to do this either (although it may mean they found a way, but it was too slow).

    Taking a slightly longer view at the 5.8.6 source tree, I think I have evidence that it's something really special here, but it's really beyond me to state conclusively that this is the case without much more time to invest.

Re: All versions of VMS files
by grinder (Bishop) on May 11, 2005 at 17:57 UTC
    a better way of getting a list of all versions of files under VMS

    Gosh, it's been a while since I did VMS. I think VMS::FindFile will help you out. It understands VMS wildcards, and will do what your looking for. E.g., it will recurse (only) if it has to.

    I don't know if this way is better, but it is different. It may be faster though.

    - another intruder with the mooring in the heart of the Perl

Re: All versions of VMS files
by Elian (Parson) on May 11, 2005 at 21:25 UTC
    Nope, that's it. Pretty much standard VMS conventions -- unless you explicitly ask for something other than the highest version, that's what you get. If you want something else, then you have to ask for it.

    There's XS required no matter what you do, though generally it's hidden. (The code to do a lot of the VMS specific stuff is XS, buried in vms/vms.c) You should be fine with what builds by default with perl on VMS, though.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://456048]
Approved by gellyfish
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2014-12-29 12:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (187 votes), past polls