Change to plumbopen so that it tries to create the port file if it does not exist. This should be a "nop" when using plumber, but it's used when using youps (a file system that implements ports and + a cut-down plumber that implements just the send and rules files). Notes: Fri Nov 18 11:28:23 EST 2005 rsc I'm not convinced. The function is called plumbopen not plumbcreate. If you really want ports to appear on demand, why not have youps just create them as needed, like mntgen does. Reference: /n/sources/patch/sorry/plumbcreate Date: Fri Nov 18 10:48:43 CET 2005 Reviewed-by: rsc --- /sys/src/libplumb/mesg.c Fri Nov 18 10:46:35 2005 +++ /sys/src/libplumb/mesg.c Fri Nov 18 10:46:33 2005 @@ -5,6 +5,19 @@ static char attrbuf[4096]; int +plumbcreate(char* name) +{ + char* n; + char buf[128]; + + n = strrchr(name, '/'); + if (n) + name = n+1; + seprint(buf, buf+128, "/mnt/plumb/%s", name); + return create(buf, ORDWR, 0660); +} + +int plumbopen(char *name, int omode) { int fd, f; @@ -21,6 +34,11 @@ fd = open(buf, omode); if(fd >= 0) return fd; + /* try creating the port first */ + fd = plumbcreate(name); + if (fd >= 0) + return fd; + return -1; /* try mounting service */ s = getenv("plumbsrv"); if(s == nil)