Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 1999 21:06:19 +0200 (CEST)
From:      Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
To:        FreeBSD Hackers <hackers@FreeBSD.ORG>
Subject:   FW: Question on rename()
Message-ID:  <XFMail.990518210619.asmodai@wxs.nl>

next in thread | raw e-mail | index | archive | help
Could you guys please give yer own opinions on that?
I will compile some of the better arguments and resend them to the Posix
revision list...

-----FW: <990518120639.ZM1866@tamarix.rdg.opengroup.org>-----

Date: Tue, 18 May 1999 13:06:40 +0100
From: Andrew Josey <ajosey@rdg.opengroup.org>
To: austin-group@opengroup.org
Subject: Question on rename()

All,
The following question was raised to my attention. I'd appreciate
thoughts on this and recommendations on the next step
best regards
Andrew

--- Forwarded mail

In POSIX 1003.1 1996 in 5.5.3.2 there is the rather unfortunate
part "If the old argument and the new argument both refer to
links to the same existing file, the rename() function shall
return successfully and perform no other action.".

In SUSV2 it is stated that
"If the old argument and the new argument both refer to,
and both link to the same existing file, rename() returns
successfully and performs no other action."

People are quite bothered by the fact that the Linux kernel
follows this, possibly too literally. One consequence is
that after a successful
        rename("aa", "bb");
it is possible that aa still exists, i.e., that
        stat("aa", &buf);
still succeeds. Another is that on a filesystem where
filenames are case-sensitive upon readdir() and creat()
but case-insensitive for open(), it may be impossible
to do
        rename("austin","Austin");
and
        rename("austin","aux"); rename("aux","Austin");
would be required.

The rationale does not mention such strange cases
and just says that the sentence is meant to ensure
that
        rename("x", "x");
does not remove the file x.
------------------------------------------------------


---End of forwarded mail

-----
Andrew Josey                                The Open Group
Austin Group Chair                          Apex Plaza,Forbury Road,
Email: a.josey@opengroup.org                Reading,Berks.RG1 1AX,England
Tel:   +44 118 9508311 ext 2250             Fax: +44 118 9500110

--------------End of forwarded message-------------------------

---
Jeroen Ruigrok van der Werven                asmodai(at)wxs.nl
        The FreeBSD Programmer's Documentation Project 
Network/Security Specialist      <http://home.wxs.nl/~asmodai>;
*BSD: Accept no limitations...


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.990518210619.asmodai>