file attributes

Erik M. van der Poel erik at sra.co.jp
Thu Jun 20 10:14:41 AEST 1991


On the Macintosh, it is possible to double click on the icon that
represents a file to invoke the application associated with that file.
It is difficult to build a GUI (graphical user interface) to do the
same for Unix systems, since Unix does not offer a standard way of
attaching an application name to a file.

It is almost possible to create a Mac-like interface on Unix, but this
involves incredibly convoluted methods such as keying off of the name
of the file, or checking the contents of the file for certain known
properties of an application's files. Again, there are no standards in
this area. Unix needs to be extended to allow attaching all sorts of
attributes to files. The inode is not extensible.

The attributes could be stored within the file itself, for example at
the beginning. However, this would upset lots of programs that assume
that the file is the data itself, just a stream of bytes, with no
standard attributes attached.

So we need a new system call, say, mopen(), which opens a file that
contains attributes such as the application name. This would allow old
programs to continue to use open() to access the data itself. The
stat() call would also be left unchanged. The size of the attributes
file could be determined by calling fstat() on the file descriptor
returned by mopen().

This means that we need two inode structures to be associated with
each file. This could be implemented by assigning two adjacent inodes
to each file. E.g. the odd one always points to the data itself, while
the even one points to the attributes.

In order to make good use of such an attributes file, however, we need
to standardize its contents. We could use object identifiers that are
registered internationally for this purpose.

Comments?
-
-- 
Erik M. van der Poel                                      erik at sra.co.jp
Software Research Associates, Inc., Tokyo, Japan     TEL +81-3-3234-2692



More information about the Comp.unix.wizards mailing list