9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Different representations of the same
@ 2009-06-17 17:05 Chad Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Chad Brown @ 2009-06-17 17:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

On Jun 17, 2009, at 1:54 AM, Charles Forsyth wrote:

>> The only drawback so far seems to be the fact that if one
>> needs flexibility, then every file becomes a subdirectory.
>> Not that it is scary or anything, but it smells too much
>> of resource forks (or may be I'm just too easily scared).
>
> it's the other way round: they ought to have represented
> collections of related data and metadata using directories
> instead of inventing rubbish like resource forks.

They sort-of-kind-of got there in Mac OS X with `application bundles'
that are just specially named directories with some canonical
contents.  It'll take another major systems change for them to wean
themselves off of resource forks entirely, I expect.

*chad

[-- Attachment #2: Type: text/html, Size: 1319 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Different representations of the same
  2009-06-17  8:54         ` Charles Forsyth
@ 2009-06-18  0:20           ` Roman V Shaposhnik
  0 siblings, 0 replies; 9+ messages in thread
From: Roman V Shaposhnik @ 2009-06-18  0:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Wed, 2009-06-17 at 09:54 +0100, Charles Forsyth wrote:
> >The only drawback so far seems to be the fact that if one
> >needs flexibility, then every file becomes a subdirectory.
> >Not that it is scary or anything, but it smells too much
> >of resource forks (or may be I'm just too easily scared).
>
> it's the other way round: they ought to have represented
> collections of related data and metadata using directories
> instead of inventing rubbish like resource forks.

Having thought of this some more, I believe you're absolutely
right. Now, the *only* thing that you don't get if you go
that route is a read/write on a "default" file representation.

Thanks,
Roman.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Different representations of the same
  2009-06-16 23:12       ` Roman V Shaposhnik
@ 2009-06-17  8:54         ` Charles Forsyth
  2009-06-18  0:20           ` Roman V Shaposhnik
  0 siblings, 1 reply; 9+ messages in thread
From: Charles Forsyth @ 2009-06-17  8:54 UTC (permalink / raw)
  To: 9fans

>The only drawback so far seems to be the fact that if one
>needs flexibility, then every file becomes a subdirectory.
>Not that it is scary or anything, but it smells too much
>of resource forks (or may be I'm just too easily scared).

it's the other way round: they ought to have represented
collections of related data and metadata using directories
instead of inventing rubbish like resource forks.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Different representations of the same
  2009-06-13  3:43     ` lucio
@ 2009-06-16 23:15       ` Roman V Shaposhnik
  0 siblings, 0 replies; 9+ messages in thread
From: Roman V Shaposhnik @ 2009-06-16 23:15 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

On Sat, 2009-06-13 at 05:43 +0200, lucio@proxima.alt.za wrote:
> > Sure, but if *each* file can have more than one representation then
> > where's the best place for the ctl thing to be? In each subdirectory?
> > At the top of the hierarchy (accepting the full path names, of course)?
>
> Well, assume you have a canonical representation for a given file, I'd
> have the ctl file in the same directory.  You'd then use a command
> that includes the basename as well as the representation selector to
> create the new entry.  If the representation directory already exists,
> then the file is added to whatever is already there, otherwise the
> directory is created first:
>
> 	; ls /n/synthetic
> 	/n/synthetic/ctl
> 	/n/synthetic/image.canonical
> 	; echo GIF image.canonical > /n/synthetic/ctl
> 	; ls /n/synthetic
> 	/n/synthetic/ctl
> 	/n/synthetic/gif
> 	/n/synthetic/image.canonical
> 	; ls /n/synthetic/gif
> 	/n/synthetic/gif/image.canonical # sic
>
> If you need additional depth to the directory, then I think you ought
> to be looking to upas/fs and how it manipulates its directory for
> further hints.

Hm. This looks more complex to me than essentially turning every file
into a "subdirectory" of sorts full of names for representations.

Thanks,
Roman.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Different representations of the same
  2009-06-13  1:56     ` erik quanstrom
@ 2009-06-16 23:12       ` Roman V Shaposhnik
  2009-06-17  8:54         ` Charles Forsyth
  0 siblings, 1 reply; 9+ messages in thread
From: Roman V Shaposhnik @ 2009-06-16 23:12 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, 2009-06-12 at 21:56 -0400, erik quanstrom wrote:
> > > I thought you might want a "ctl" file into which you write the
> > > representation you want and that magically creates a new file or
> > > directory.
> >
> > Sure, but if *each* file can have more than one representation then
> > where's the best place for the ctl thing to be? In each subdirectory?
> > At the top of the hierarchy (accepting the full path names, of course)?
> [...]
> > I'm simply asking for the best practices.
>
> generally, plan 9 fs pick a cannonical format if they can get
> away with it.
>
> the right answer is going to depend very strongly on one's
> exact constraints.
>
> if the client knows he's always going to want pngs, it might
> be good to pass png as the spec, as in
> 	; mount /srv/media /n/media png
> i suppose this would be a lot like content negotiation.

Exactly! From where I stand it seems that a particular
representation has to be either part of the name, or
it has to hide in a "invisbible" part of the protocol.

The benefits of having representation spec being part
of the name are obvious -- you are alway know what you're
asking for, plus you can explicitly list representations
if there's more than one.

The only drawback so far seems to be the fact that if one
needs flexibility, then every file becomes a subdirectory.
Not that it is scary or anything, but it smells too much
of resource forks (or may be I'm just too easily scared).

> there are some really wild examples running about.  hackery in
> upas that will serve up x(\.$e)? for any $e in certain circumstances.
> (see upas/ned/nedmail.c:/^plumb.)  the reason for this is so that
> upas/fs can serve up content with type unknown to upas/fs so
> that it can match plumbing rules that expect file extensions.
> the alternative would have been to add an explicitly declared filetype to
> the plumb messages and adding a ruletype to the plumb files.
> i suppose the idea was to not break everyone's plumbing rules.

Interesting...

Thanks,
Roman.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Different representations of the same
  2009-06-13  1:02   ` Roman V Shaposhnik
  2009-06-13  1:56     ` erik quanstrom
@ 2009-06-13  3:43     ` lucio
  2009-06-16 23:15       ` Roman V Shaposhnik
  1 sibling, 1 reply; 9+ messages in thread
From: lucio @ 2009-06-13  3:43 UTC (permalink / raw)
  To: 9fans

> Sure, but if *each* file can have more than one representation then
> where's the best place for the ctl thing to be? In each subdirectory?
> At the top of the hierarchy (accepting the full path names, of course)?

Well, assume you have a canonical representation for a given file, I'd
have the ctl file in the same directory.  You'd then use a command
that includes the basename as well as the representation selector to
create the new entry.  If the representation directory already exists,
then the file is added to whatever is already there, otherwise the
directory is created first:

	; ls /n/synthetic
	/n/synthetic/ctl
	/n/synthetic/image.canonical
	; echo GIF image.canonical > /n/synthetic/ctl
	; ls /n/synthetic
	/n/synthetic/ctl
	/n/synthetic/gif
	/n/synthetic/image.canonical
	; ls /n/synthetic/gif
	/n/synthetic/gif/image.canonical # sic

If you need additional depth to the directory, then I think you ought
to be looking to upas/fs and how it manipulates its directory for
further hints.

Whether this is any better than content negotiation may be a judgement
call.  I'll read the wikipedia entry later, thank you for pointing me
to it.

++L




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Different representations of the same
  2009-06-13  1:02   ` Roman V Shaposhnik
@ 2009-06-13  1:56     ` erik quanstrom
  2009-06-16 23:12       ` Roman V Shaposhnik
  2009-06-13  3:43     ` lucio
  1 sibling, 1 reply; 9+ messages in thread
From: erik quanstrom @ 2009-06-13  1:56 UTC (permalink / raw)
  To: 9fans

> > I thought you might want a "ctl" file into which you write the
> > representation you want and that magically creates a new file or
> > directory.
>
> Sure, but if *each* file can have more than one representation then
> where's the best place for the ctl thing to be? In each subdirectory?
> At the top of the hierarchy (accepting the full path names, of course)?
[...]
> I'm simply asking for the best practices.

generally, plan 9 fs pick a cannonical format if they can get
away with it.

the right answer is going to depend very strongly on one's
exact constraints.

if the client knows he's always going to want pngs, it might
be good to pass png as the spec, as in
	; mount /srv/media /n/media png
i suppose this would be a lot like content negotiation.

there are some really wild examples running about.  hackery in
upas that will serve up x(\.$e)? for any $e in certain circumstances.
(see upas/ned/nedmail.c:/^plumb.)  the reason for this is so that
upas/fs can serve up content with type unknown to upas/fs so
that it can match plumbing rules that expect file extensions.
the alternative would have been to add an explicitly declared filetype to
the plumb messages and adding a ruletype to the plumb files.
i suppose the idea was to not break everyone's plumbing rules.

- erik



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Different representations of the same
  2009-06-11  4:49 ` [9fans] Different representations of the same lucio
@ 2009-06-13  1:02   ` Roman V Shaposhnik
  2009-06-13  1:56     ` erik quanstrom
  2009-06-13  3:43     ` lucio
  0 siblings, 2 replies; 9+ messages in thread
From: Roman V Shaposhnik @ 2009-06-13  1:02 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

On Thu, 2009-06-11 at 06:49 +0200, lucio@proxima.alt.za wrote:
> > but at that point it becomes no more appealing than the content
> > negotiation techniques of HTTP.
>
> I thought you might want a "ctl" file into which you write the
> representation you want and that magically creates a new file or
> directory.

Sure, but if *each* file can have more than one representation then
where's the best place for the ctl thing to be? In each subdirectory?
At the top of the hierarchy (accepting the full path names, of course)?

>  Or use a "clone" style protocol which is more suitable for
> the automatic creation of new entities.

"clone" doesn't quite work for me in REST world (not that it can't
be made to work, it is just complicated).

> Of course, you may specifically want to go for a totally different
> approach, in which case I plead guilty to not understanding the exact
> nature of the solution you're seeking.

I'm simply asking for the best practices. Also, as I admitted in
my original email, I'm not really implementing this in 9P. So I
have an option that is native to the protocol I'm using: content
negotiation (http://en.wikipedia.org/wiki/Content_negotiation)

Now, since 9P doesn't have that I was simply wondering what would
be the agreed upon wisdom to have the same functionality
_cleanly_ implemented in a 9P based synthetic filesystem.

Thanks,
Roman.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Different representations of the same
  2009-06-11  3:44 [9fans] Different representations of the same file/resource in a synthetic FS Roman V. Shaposhnik
@ 2009-06-11  4:49 ` lucio
  2009-06-13  1:02   ` Roman V Shaposhnik
  0 siblings, 1 reply; 9+ messages in thread
From: lucio @ 2009-06-11  4:49 UTC (permalink / raw)
  To: 9fans

> but at that point it becomes no more appealing than the content
> negotiation techniques of HTTP.

I thought you might want a "ctl" file into which you write the
representation you want and that magically creates a new file or
directory.  Or use a "clone" style protocol which is more suitable for
the automatic creation of new entities.

The "mntgen" approach is clever, but I find the Schroedinger Cat
nature of it a little daunting.

Of course, you may specifically want to go for a totally different
approach, in which case I plead guilty to not understanding the exact
nature of the solution you're seeking.

++L




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-06-18  0:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-17 17:05 [9fans] Different representations of the same Chad Brown
  -- strict thread matches above, loose matches on Subject: below --
2009-06-11  3:44 [9fans] Different representations of the same file/resource in a synthetic FS Roman V. Shaposhnik
2009-06-11  4:49 ` [9fans] Different representations of the same lucio
2009-06-13  1:02   ` Roman V Shaposhnik
2009-06-13  1:56     ` erik quanstrom
2009-06-16 23:12       ` Roman V Shaposhnik
2009-06-17  8:54         ` Charles Forsyth
2009-06-18  0:20           ` Roman V Shaposhnik
2009-06-13  3:43     ` lucio
2009-06-16 23:15       ` Roman V Shaposhnik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).