List Info

Thread: rename directories on VMS like on UNIX




rename directories on VMS like on UNIX
user name
2007-08-30 22:59:50
The rename() routine in most versions of the VMS CRTL will
not rename 
directories.  It returns an error on the attempt.

Some versions of VMS have a feature setting that changes
this behavior.

This patch implements a Perl_rename() that operates the same
way as 
rename() does on UNIX as far as directories are concerned,
and should 
work on all versions of VMS that Perl is currently being
built for.

It follows the same rules on file protections as the
existing Perl 
rmdir() and unlink() functions do on VMS.  This is a change
to the 
previous rename() behavior, but makes it consistent with
unlink().

Code is also in place to properly handle symbolic links in a
rename 
operation.

In addition, there is now (untested) support for a VMS
specific feature 
controlled by the logical name
PERL_VMS_UNLINK_ALL_VERSIONS.

This controls the behavior of both C<rename> and
C<unlink()> and when 
set to ENABLE will cause unlink() to remove all versions,
and a 
successful rename() to result in only one version of the
destination 
file remaining and no versions of the source existing.

This will make the VMS Configure.com option
-dunlink-all-versions 
obsolete.  From what I can determine, the only thing that
used it was 
one module, and the rest of Perl just ignored the setting.

Running perl scripts written for UNIX on VMS may require
this feature.

-John
wb8tywqsl.net
Personal Opinion Only

  
Re: rename directories on VMS like on UNIX
user name
2007-08-31 04:11:34
Hi,

I think you meant

+#define rename(a, b)        Perl_rename(aTHX_ a, b)

instead of

+#define rename(a, b)        Perl_rename(aTHX_ a)

Otherwise, I'm not qualified to audit VMS code.

Vincent.


Re: rename directories on VMS like on UNIX
user name
2007-08-31 11:33:15
Vincent Pit wrote:
> Hi,
> 
> I think you meant
> 
> +#define rename(a, b)        Perl_rename(aTHX_ a, b)
> 
> instead of
> 
> +#define rename(a, b)        Perl_rename(aTHX_ a)
> 
> Otherwise, I'm not qualified to audit VMS code.

Yes, this is what happens when I skip the 5 to 6 hour step
of also 
building a threaded Perl on VMS.

-John
wb8tywqsl.network
Personal Opinion Only

Re: rename directories on VMS like on UNIX
user name
2007-08-31 18:09:12
At 11:33 AM -0500 8/31/07, John E. Malmberg wrote:
>Vincent Pit wrote:
>>Hi,
>>
>>I think you meant
>>
>>+#define rename(a, b)        Perl_rename(aTHX_ a,
b)
>>
>>instead of
>>
>>+#define rename(a, b)        Perl_rename(aTHX_ a)
>>
>>Otherwise, I'm not qualified to audit VMS code.
>
>Yes, this is what happens when I skip the 5 to 6 hour
step of also building a threaded Perl on VMS.

It "only" takes me about 3 1/2 hours, but you can
find out in about 5
minutes whether vms.c will compile with a thread-enabled
configuration, and it's rare to get a clean compile that
causes
further trouble.  In the end there were about half a dozen
minor
edits needed to get it to compile with threads, the result
applied as
#31777.
-- 
________________________________________
Craig A. Berry
mailto:craigberrymac.com

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

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )