From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: islands
Organization: Weber State University  (Ogden, UT)
Date: Mon, 11 Jan 93 19:06:44 GMT

In article <C0MKEu.5or@poel.juice.or.jp> erik@poel.juice.or.jp (Erik M. van der Poel) writes:
>One conceivable approach is to extend this rudimentary
>file typing to actual file attributes ("groan, not this guy again" I
>hear all of you saying), extending NFS as well with a negotiated file
>type option.

This is the approach I advocate; I have already made a version of the
4.3 UFS (for 386BSD) which includes per-file locale typing.  For a
multilingual document, this type is LL_MULTILINGUAL... monolingual
documents have a locale specific typing based on the language used.

The big problem, as Ohta pointed out, is the "cat" problem.  I have this
solved for all but one pessimal case.  This is fairly easy if you handle
several issues up front:

o	All file arguments to cat are checked for type; cat is linked
	with a library (I have not yet made it a shared library, but
	I will) which can convert from monolingual to a simple format
	for embedded multilingual.  To do this, I have stolen several
	code points within Unicode for locale attribution; in a font,
	these code points would be represented as non-spacing blanks.
	These code points are embedded in the output stream as the
	conversion from attributed monolingual to multilingual takes
	place.

o	All in-core file descriptors must handle language attribution
	via ioctl.  This allows language attribution of pipes by
	type, as well as assignment of locale information to files
	created by redirection of the output to "cat".

o	Output coercion.


Currently, I am only forcing attribution, not "compact storage" using a
per language 8-bit spanning set.  I expect this to provide a reduction
to pre-international storage for small glyph-set languages, as well as
interoperability with existing non-internationalized systems.

The pessimal case which is disallowed is the input through a pipe of
multiple streams of non-monolingual data which would thus result in
a loss of attribution (unless interchange was always done using the
in-band attribution -- I felt this would be "bad").  For those of you
who are having a hard time coming up with an example of this case:

	:
	# pessimal use of cat with attributed data
	#

	for i in file.1 file.2 file.3
	do
		cat $i
	done | cat > file.multi

Some may note that the construct:

	:
	# questionable case
	#

	for i in file.1 file.2 file.3
	do
		cat $i
	done > file.multi

Should fail also.  This is not the case, because output is coerced to
be multinational by the shell providing the transitional stream for
the output of each of the "cat" commands (stdout), which is attributed
with a non-modifiable attribute which is checked by "cat" before it
decides on the output format.

This does have the drawback that the case of "file.1", "file.2", and
"file.3" containing data in the same monolingual locale result in a
"multilingual" file on output.  I'll respond that the proper mechanism
for the operation in question is:

	:
	# proper way to do questionable case

	cat file.1 file.2 file.3 > file.multi

and that even if this isn't observed, the resulting file is both usable
and "compactable" to a non-multilingual locale, perhaps by a post-pass
mechanism running as a cron job.

If you are interested in a more general discussion of file system
attribution and transport extension (since, as you suggest, an NFS
extension could be useful for homogenous internationalized systems,
thus avoiding "the island problem"), you should check out John
Heidemann's papers on Ficus (available by anonymous FTP from ftp.ucla.edu)
and David Rosenthal's "Evolving the vnode interface" in the June 1990
USENIX Conference Proceedings (pages 107-118).


					Terry Lambert
					terry@icarus.weber.edu
					terry_lambert@novell.com
---
Any opinions in this posting are my own and not those of my present
or previous employers.
-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------
Newsgroups: comp.std.internat