I did not like the one sent in the previous patch. I think this one is more clean and correct. I tried with acme and omero with plumber and youps. Notes: Mon Nov 28 07:08:45 EST 2005 rsc Please be more careful about spacing. In almost every patch you submit, the spacing around () in if statements is not consistent with the surrounding code. Reference: /n/sources/patch/applied/plumbopenwithcreate Date: Mon Nov 21 15:59:39 CET 2005 Reviewed-by: rsc --- /sys/src/libplumb/mesg.c Mon Nov 21 15:59:06 2005 +++ /sys/src/libplumb/mesg.c Mon Nov 21 15:59:03 2005 @@ -11,8 +11,12 @@ char *s; char buf[128]; - if(name[0] == '/') - return open(name, omode); + if(name[0] == '/'){ + fd = open(name, omode); + if (fd < 0) + fd = create(name, omode, 0600); + return fd; + } snprint(buf, sizeof buf, "/mnt/plumb/%s", name); fd = open(buf, omode); if(fd >= 0) @@ -21,6 +25,11 @@ fd = open(buf, omode); if(fd >= 0) return fd; + snprint(buf, sizeof buf, "/mnt/plumb/%s", name); + fd = create(buf, omode, 0600); + if (fd >= 0) + return fd; + /* try mounting service */ s = getenv("plumbsrv"); if(s == nil)