Subject: Named attributes

From: "Dan Trufasiu" <[email-masked]>
Date: Mon, 18 Feb 2002 15:49:49 -0500

I don't know if this a question for the protocol or only for the
implementation.
If the client requests to CREATE a file and the file already exists, does
the client has to delete/replace/update the named attributes, or the old
named attributes will be removed by the CREATE process?

Thanks

Dan

---

From: Jim Rees <[email-masked]>
Date: Wed, 20 Feb 2002 20:58:36 -0500

We had this discussion last July.  Named attributes are in general used for
storing file metadata that the file system itself doesn't store.  An example
often cited is mime type, which these days is usually encoded in the file
name, but is more properly an attribute.

Some examples given in the last discussion were immutable, append-only, and
compressed.  There were also pointers to a couple of documents:

http://www.linuxcentral.com/linux/man-pages/chattr.1.html
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/hh/winbase/filesio_6c8i.asp

The Mac file system is also often used as an example of one that makes
copious use of file metadata.

I have a vague memory of another document that traced the history of file
metadata and attributes and made suggestions for future file system
implementations, but I can't seem to find it now.

Of course the main problem with attributes stored separately from the file
contents is that they tend to get lost when copying, unless everything that
might copy a file has been modified.  Apple never really solved this
problem.

---

From: "Khan, Saadia" <[email-masked]>
Date: Wed, 20 Feb 2002 10:45:41 -0800

yes, you are correct, the attributes should stay even if the base
file is truncated.

Saadia

-----Original Message-----
From: Spencer Shepler [mailto:[email-masked]]
Sent: Tuesday, February 19, 2002 3:56 PM
To: [email-masked]
Subject: Re: Named attributes

On Tue, Spencer Shepler wrote:
> On Tue, Khan, Saadia wrote:
> > If the file already exists and its a guarded create case, then the
> > server can just return EEXIST without touching the named attributes,
> > so the server will not remove the attributes. 
> > 
> > If O_TRUNC is set, then the file will be deleted along with the 
> > named attributes.
> 
> Does everyone agree with this interpretation?  If so, I will need to
> add this to the RFC update.

As other have pointed out to me, this does seem opposite to the
regular attributes of a file when it is truncated.  The mode isn't
changed with O_TRUNC (unless setuid/setgid is set) or group isn't
reset as a result of O_TRUNC.  Should named attributes be removed as a
result of O_TRUNC.  Is this behavior exist in operating environments
today and if so, which ones?

Spencer