HP3000-L Archives

September 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Tue, 19 Sep 2000 09:29:24 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (40 lines)
[log in to unmask] wrote:
> Some of the scripts we are porting to MPE/iX 6.5 use Perl's rename
> function in an intended atomic manner.  This works on all of our other
> ported systems like AIX, Sun, HP-UX, Linux, etc, but not MPE.  Here is
> how to recreate the bug:
>
> - create a symbolic link to any other file on the file system in your
> current directory
> - create a file, <file>, using vi (or whatever) named something
> different in the current directory as well
> - run perl -e 'rename("<file>","<symlink>");'
>
> The operation should accomplish nothing.  Doing the same on another
> system like AIX will trash the link and overwrite the symlink with the
> file.

This seems like a bug in the underlying POSIX rename() function.  Duplicating
it using just the shell:

nomad:/BIXBY/PUB/testdir$ touch file
nomad:/BIXBY/PUB/testdir$ ln -s file link
nomad:/BIXBY/PUB/testdir$ touch another
nomad:/BIXBY/PUB/testdir$ mv another link
link? y
mv: cannot rename "another" to "link": System call error

On Linux, this would have caused the symlink "link" to be deleted, and then
"another" would be renamed to "link".

So it seems that MPE rename() should be willing to overwrite symlinks.

FWIW, I've successfully used Perl atomic renames on MPE, but in those
applications if the target file already exists it is a regular file and not a
symlink, so I've never seen this error before.

As far as I can tell, nobody has reported this bug before, so please open an HP
Response Center call and report it from your customer perspective.

- Mark B.

ATOM RSS1 RSS2