Re: rmdir('/unix_path/to/dir') not working with 5.18.1?

"Craig A. Berry" <[email protected]> Fri, 07 Mar 2014 08:18:25 -0600
Newsgroups gmane.comp.lang.perl.ports.vms
Message-ID <[email protected]>
On Feb 26, 2014, at 11:35 PM, John E. Malmberg =
<[email protected]> wrote:

> On 2/25/2014 7:02 PM, Craig A. Berry wrote:
>>=20
>> On Feb 24, 2014, at 11:33 PM, John E. Malmberg =
<[email protected]> wrote:
>=20
>>> I can not seem to do a rmdir() of an absolute or relative Unix
>>> path  with Perl 5.18.1.
>>=20
>> It works unless DECC$FILENAME_UNIX_REPORT is defined. That's not
>> particularly well tested and you definitely found a bug. If that's
>> defined, when rmdir calls the internal stat routine, which calls
>> fileify, then 'abc/xyz' becomes 'abc/xyz.DIR;1'.
>=20
> If fileify is converting 'abc/xyz' to 'abc/xyz.DIR;1', that is a bug =
that will break a lot of stuff.  With the DECC$EFS_CHARSET enabled, that =
should never happen anywhere.
>=20
> Not only should the ;1 not be present, the ".DIR" should not be =
present either.

I think we've had this discussion before.  Fileify really has to append =
the .DIR;1 because there are too many things, rmdir being one of them, =
that simply cannot operate on a directory spec but only on a directory =
file. That's really the point of fileify and we wouldn't call it if we =
didn't have to.

>> Then stat converts it to VMS format and we get something like
> > 'D0:[craig.TEST.abc]xyz.DIR^;1'.

I tested this with decc$to_vms using the example in on-line help and it =
does not escape a semicolon that is part of a valid version spec. It =
does escape it if the version spec is not valid (or if the semicolon =
appears somewhere else in the name):

$ mcr []to_vms abc/xyz.dat;32767
Translating: abc/xyz.dat;32767
file:        [.ABC]XYZ.DAT;32767
1 files found
$ mcr []to_vms abc/xyz.dat;123456789
Translating: abc/xyz.dat;123456789
file:        [.ABC]XYZ.DAT^;123456789
1 files found

Neither DECC$EFS_CHARSET nor DECC$FILENAME_UNIX_REPORT has any impact on =
this.  So I've changed vmsify in Perl to do exactly the same thing the =
CRTL does.  Well, not exactly because the CRTL honors =
DECC$FILENAME_UNIX_NO_VERSION by escaping the semicolon even if the =
version spec is valid:

$ DEFINE DECC$FILENAME_UNIX_NO_VERSION 1
$ mcr []to_vms abc/xyz.dat;32767
Translating: abc/xyz.dat;32767
file:        [.ABC]XYZ.DAT^;32767
1 files found

I haven't (yet) made Perl do this.  It wouldn't be hard to do, but I'm a =
little skeptical about trying to support the whole wilderness of feature =
logicals.
________________________________________
Craig A. Berry
mailto:[email protected]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser