Damn phone didn't let me reply all

Begin forwarded message:

From: "J. R. Mauro" <jrm8005@gmail.com>
Date: July 1, 2009 10:00:44 EDT
To: Mike Frysinger <vapier@gentoo.org>
Subject: Re: [Wlug] Making a pipe or socket look like a file.





On Jul 1, 2009, at 9:33, Mike Frysinger <vapier@gentoo.org> wrote:

On Tuesday 30 June 2009 22:35:44 J. R. Mauro wrote:
On Jun 30, 2009, at 22:24, Mike Frysinger wrote:
On Tuesday 30 June 2009 21:47:18 J. R. Mauro wrote:

please dont top post

Who did?

i'm guessing you made this comment ironically

Actually, I was probably drunk, and I was definitely typing on my phone both times, so forgive me if I wasn't an ml-etiquette zealot.

Moving things is a worse sin than top posting.



On Jun 30, 2009, at 21:42, Alex Camilo <alex.camilo@gmail.com> wrote:
I'm trying to extend the functionality of a piece of CAD software
i'm using. The software package is called eagle and it has a custom
in application scripting language that allows you to access an open
CAD document  by manipulating a tree of objects. The scripting
language is fairly limited when it comes to talking to the outside
world and only offers rudimentary file IO. I was wondering if any of
you know how to make one end of a unix socket look like a file?

Unfortunately, you can't. It's one of the design flaws of Unix. You
might be able to wrap it with a FUSE filesystem. But sockets and
FIFOs
are unfortunately "special"

i imagine you could use netcat to redirect from a named pipe so that
you can

FIFOs are kind of a hack.

no one said otherwise.  the fun thing about *nix is you can leverage these
kind of hacks quickly.

And then go through the pain of hacking on top of them and supporting them. The *real* unix mindset was careful, elegantly minimal design, not ad-hackery. That started outside Bell Labs.

c.f. most perl programs



Make a fuse filesystem in 20 lines of python
and you get something more robust and specialized, plus network
transparency for free

if you say so, i havent done fuse work myself
-mike

It's laughably easy. I had a filesystem written to expose stuff from the x server (mouse coordinates, snarf buffer, etc) in about four hours. The hard part was dealing with how crappy x11 is (400 lines to r/w the snarf buffer?! Gag me with a spoon! X is the epitome of bad design and bad APIs)  The fuse part was a joy, and probably all of it was fewer lines than the snarf buffer.

It seems like the OP wants a permanent solution, and maybe one that involves biderectional communication and separation of roles into multiple channels (he didn't say the last bit, but I've got five bucks that says he'll want to once he thinks about it and looks at other fileserver-based programs like Acme, rio, factotum, flickrfs, etc)

Using fifos for this is lunacy.