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 postWho 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 softwarei'm using. The software package is called eagle and it has a customin application scripting language that allows you to access an openCAD document by manipulating a tree of objects. The scriptinglanguage is fairly limited when it comes to talking to the outsideworld and only offers rudimentary file IO. I was wondering if any ofyou 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. Youmight be able to wrap it with a FUSE filesystem. But sockets andFIFOsare unfortunately "special"i imagine you could use netcat to redirect from a named pipe so thatyou canFIFOs are kind of a hack.no one said otherwise. the fun thing about *nix is you can leverage thesekind 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 programsMake a fuse filesystem in 20 lines of pythonand you get something more robust and specialized, plus networktransparency for freeif 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.