BFS attributes!

I’ve created a simple no-compression archive format similar to TAR, and I’m in the process of implementing support for arbitrary file attributes. I want to make sure that my format will preserve all BFS information.

Does anyone know of where I can find some specifics about BFS attributes? I found a little bit in Practical File System Design, but not enough to fulfill my requirements.

I’ve never programmed for the BeOS before, so forgive me if some of my questions are stupid; I’m doing this in ANSI C and once I work out the kinks in the format, I’ll implement it for BeOS (which is the intended end result) in C++. Anyway, here are some of the less technical questions I need answered:

  1. Is there a universal set of required attributes that all files have (i.e. modified time, date created, etc.)? If so, what are they?
  2. Can directories have attributes?
  3. Are symbolic links considered files by the BFS?
  4. Are MIME types stored as file attributes or are they stored elsewhere?

Any resources (or answers) whatsoever would be greatly appreciated! :slight_smile:

j_freeman wrote:
Any resources (or answers) whatsoever would be greatly appreciated! :)

You may have better luck if you subscribe to the Haiku mailing list and send message there, as it is watched by most haiku/beos devs.

http://www.freelists.org/list/openbeos

Good luck!

j_freeman wrote:
I've created a simple no-compression archive format similar to TAR...

HAR?

Hi,
I am not on BeOS at the moment so here only some thoughts that I have in my mind:

>Is there a universal set of required attributes that all files have (i.e. >modified time, date created, etc.)? If so, what are they?

in the terminal copy a file from a no bfs partion to the bfs then make an listattr on this file you will see the basic attributes
then use in the tracker the fileinfo addon on this file. Now you will see the the new attribute BEOS:TYPE there is stored the mime type…

>Can directories have attributes?
may be the trick above?

>Are symbolic links considered files by the BFS?
I think so…

>Are MIME types stored as file attributes or are they stored elsewhere?
yes in BEOS:TYPE

In the terminal this tools are helpfull: listattr, getattr, addattr, and rmattr
for index: lsindex, mkindex…

koki wrote:
j_freeman wrote:
Any resources (or answers) whatsoever would be greatly appreciated! :)

You may have better luck if you subscribe to the Haiku mailing list and send message there, as it is watched by most haiku/beos devs.

http://www.freelists.org/list/openbeos

Good luck!

Yes, I’m subscribed to the list. But I didn’t want to disturb them with trivial things like this unless I have to. (BTW, they’re having a brainstorming session with regards to the new netstack. Very exciting stuff!)

umccullough wrote:
j_freeman wrote:
I've created a simple no-compression archive format similar to TAR...

HAR?

Are you suggesting the name be called that? (As in Haiku ARchive?) I considered it, but there seems to be a format by that name already.

ZzLeCzZ wrote:
Hi, I am not on BeOS at the moment so here only some thoughts that I have in my mind:

>Is there a universal set of required attributes that all files have (i.e. >modified time, date created, etc.)? If so, what are they?

in the terminal copy a file from a no bfs partion to the bfs then make an listattr on this file you will see the basic attributes
then use in the tracker the fileinfo addon on this file. Now you will see the the new attribute BEOS:TYPE there is stored the mime type…

>Can directories have attributes?
may be the trick above?

>Are symbolic links considered files by the BFS?
I think so…

>Are MIME types stored as file attributes or are they stored elsewhere?
yes in BEOS:TYPE

In the terminal this tools are helpfull: listattr, getattr, addattr, and rmattr
for index: lsindex, mkindex…

Thanks! I’ll try these tools out tonight.

One question about the BEOS:TYPE attribute; the key is "BEOS:TYPE", I assume? The type must be a string then?

There is also catattr, which you could use like catattr BEOS:TYPE filename which would return the string.

j_freeman wrote:
One question about the BEOS:TYPE attribute; the key is "BEOS:TYPE", I assume? The type must be a string then?

Yup and yup, the key is often refered to as "name" though, as in attribute name, and the value is a MIME str, like text/plain.

I’m almost certain dirs can have attribs. More info can probably be found at http://www.beunited.org/bebook/The%20Storage%20Kit/index.html

tqh wrote:
I'm almost certain dirs can have attribs. More info can probably be found at http://www.beunited.org/bebook/The%20Storage%20Kit/index.html

Thanks, I forgot about that one. :smiley: And you’re right about directories: "Every file—whether it’s a document, an application, or even a directory has its own file type attribute."

I guess that includes symbolic links? I might contact BGA or Axel this weekend to get some more details.