[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flaw in %readfrom and %writeto



erik quanstrom <quanstro@infomkt.ibm.com> writes:

> >Yep, that's right.  Don't most systems support /dev/fd these days,
> >making the temp file kludge less necessary?
> 
> no. aix, for example. 
> 
> >> I actually never understood why $pid does not change in a forked subshell,
> >> but that's a different matter.
> 
> >So you can do things like
> >
> >  { mumble > /tmp/poot.$pid } &
> >  rm /tmp/poot.$pid
> >
> >and have them work on the same file.  Behavior inherited from /bin/sh.
> 
> why would you want that? if you really want that behavior,
> then you can implement it by doing the floowing if subshells
> change $pid
> 
>         parentPid = $pid
> 
>         { mumble > /tmp/poot.$parentPid } &
>         rm /tmp/poot/$parentPid

note the `behaviour inherited from /bin/sh'.  This would be unfortunate
to break.  Perhaps another way to do this would be to provide a $&getpid
primitive?  While this is not ideal, it would work.

What do people think?

Soren