On Feb 26, 2014, at 11:35 PM, John E. Malmberg <malmb...@encompasserve.org> 
wrote:

> On 2/25/2014 7:02 PM, Craig A. Berry wrote:
>> 
>> On Feb 24, 2014, at 11:33 PM, John E. Malmberg <malmb...@encompasserve.org> 
>> 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'.
> 
> 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.
> 
> 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:craigbe...@mac.com

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

Reply via email to