| those who know me have no need of my name 2004-04-18, 10:42 am |
| in comp.unix.questions i read:
>if someone on purpose or by accident accesses the pipe in the meantime
>during my usage, there will be a lack of data, as this pipe is open to
>all usage as long as it "lives".
>I can't believe that there should be no command to restrict the access,
there are no such commands, not even the notion, in a classical unix-ish
system. some modern systems may have acl's you can apply (though they tend
to be highly system specific) or you can use the classic solution of
removing the file after the reader (gzip) has it open -- neither are atomic
so there is still a period of time which is vulnerable.
an example of the later, which should executed via a single call to the
shell is:
mknod apipe$$ p ; gzip -1 < apipe$$ > apipe$$.gz & rm -f apipe$$
i've used $$ so that the same program running more than one at a time will
not destroy each other's files. whether that's appropriate you will have
to decide.
--
a signature
|