Frank Hofmann <[EMAIL PROTECTED]> wrote:

>
>
> On Fri, 28 Dec 2007, Joerg Schilling wrote:
> [ ... ]
> > POSIX grants that st_dev and st_ino together uniquely identify a file
> > on a system. As long as neither st_dev nor st_ino change during the
> > rename(2) call, POSIX does not prevent this rename operation.
>
> Clarification request: Where's the piece in the standard that forces an 
> interpretation:
>
>       "rename() operations shall not change st_ino/st_dev"
>
> I don't see where such a requirement would come from.

See: http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html

"The st_ino and st_dev fields taken together uniquely identify the file within 
the system."

The identity of an open file cannot change during the lifetime of a process.
Note that the renamed file may be open and the process may call fstat(2)
on the open file before and after the rename(2). As rename(2) does not change
the content of the file, it may only affect the time stamps of the file.

Note that some programs call stat/fstat on files in order to compare file 
identities. What happens if program A calls stat("file1"), then program B
calls rename("file1", "file2") and after that, program A calls stat("file2").
A POSIX compliant system will grant that stat("file1") and stat("file2") will
return the same st_dev/st_ino identity.



Jörg

-- 
 EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
       [EMAIL PROTECTED]                (uni)  
       [EMAIL PROTECTED]     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
Jörg

-- 
 EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
       [EMAIL PROTECTED]                (uni)  
       [EMAIL PROTECTED]     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to