I have a module which I want to run on VMS. The module itself is now fine (I
have bitten the bullet with File::Spec::Functions, using its subs throughout.

The problem I am having is with the module's test suite. The first test is one
which clears out any previous test session files. Here is the code:


# This is a special 'test' to clear out the residue from any
# previous tests that were run, prior to rerunning the tests.

# Note: this needs to be portable, so we can't use `rm -rf test`.
#########################

use Test::More  tests => 1;
use File::Find;

find( {
        bydepth => 1,
        wanted => sub { (-d $_) ? rmdir($_) : unlink($_); },
        }, 'test');

rmdir 'test';

ok(!(-d 'test'),"Test directory removed");

---------------------------------------------

This works fine on Unix and Windows.

I have two problems with this on VMS. The old chestnut about protected 
directories (you have to do a set prot=o:d before you can delete). This
I can work around with adding some extra code if $^O is VMS.

The more serious problem is that the code does not handle file multiversions.
How can I get File::Find to see them. Alternatively I could test $^O and
do something completety different, such as spawning out `del [.test...]*.*;*`
but I feel that this is a) cheating and b) not in the spirit of portability.

Has anybody already written something that fits the bill? Is it possible to
tell File::Find (or indeed a dirhandle) that you want to see all the back
versions?

Any help would be appreciated.

Ivor.

Reply via email to