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

[email protected] ("Craig A. Berry") Tue, 25 Feb 2014 19:02:05 -0600
Newsgroups perl.vmsperl
Message-ID <[email protected]>
On Feb 24, 2014, at 11:33 PM, John E. Malmberg =
<[email protected]> wrote:


> I can not seem to do a rmdir() of an absolute or relative Unix path =
with Perl 5.18.1.

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'.  Then stat converts it =
to VMS format and we get something like 'D0:[craig.TEST.abc]xyz.DIR^;1'.

So we probably need to have fileify omit the version with unix report =
enabled.

> I have worked around the issue by replacing the rmdir() builtin method =
with one that translates the filename to VMS format and then calls =
unlink().
>=20
> LION> perl  --version
>=20
> This is perl 5, version 18, subversion 1 (v5.18.1) built for VMS_IA64
>=20
> LION> show log decc$*
>=20
> (LNM$PROCESS_TABLE)
>=20
>  "DECC$EFS_CASE_PRESERVE" =3D "ENABLE"
>  "DECC$EFS_CHARSET" =3D "ENABLE"

For future reference, those two are on by default in Perl 5.18.x.

>  "DECC$FILENAME_UNIX_NOVERSION" =3D "ENABLE"
>  "DECC$FILENAME_UNIX_REPORT" =3D "ENABLE"
>  "DECC$READDIR_DROPDOTNOTYPE" =3D "ENABLE"
>=20
> LION> show log perl_*
>=20
> (LNM$PROCESS_TABLE)
>=20
>  "PERL_ROOT" =3D "LION$DKA0:[SYS0.SYSCOMMON.perl-5_18.]"
>=20
>=20
> I also noticed that opendir('/search_list/directory') fails when =
'directory' is only in the first member of the search list.  I am not =
sure what the issue there is.  I think the solution for that will be =
more complex.

Not sure what's going on there but I'll try to have a look soonish.

> I have worked around that issue by decoding the search list and =
recreating the path to used for opendir.
>=20



________________________________________
Craig A. Berry
mailto:[email protected]

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