I do not know, either, but you can close an already closed file handle, so:

#include <unistd.h>

void closeMostFiles() {
    int f;
    for (f= 0; f < 256; f++) {
        close(f);
    }
}

If using that routine remedies the symptom you are seeing, it will be
worth looking at this in more depth.  If not, it will probably be a
different issues.

-- 
Raul

On Tue, Feb 14, 2012 at 6:27 PM, Ian Clark <earthspo...@gmail.com> wrote:
> I wasn't aware any file handles were inherited. Where do I find them
> to close? (...Unix rabbit).
>
> (The same code works without trouble in j602.)
>
> On Tue, Feb 14, 2012 at 9:25 PM, Raul Miller <rauldmil...@gmail.com> wrote:
>> Have you tried closing the file handles the child process inherits
>> from the parent?
>>
>> --
>> Raul
>>
>> On Tue, Feb 14, 2012 at 4:04 PM, Ian Clark <earthspo...@gmail.com> wrote:
>>> 2!:1 is not truly asynchronous in JHS, it seems. The net result is
>>> that I cannot see how to launch a child process without the session
>>> hanging until the child terminates.
>>>
>>> Strange to say, the jijx session immediately resumes, and will accept
>>> (re-)input. But it will not execute the inputted expression. Inside a
>>> verb however, execution continues past 2!:1 (which successfully forks
>>> the child process), but after completion of the verb the session is
>>> silent (until the child process is terminated).
>>>
>>> Example:
>>> Suppose test6s.wav is a sound file lasting 6 seconds. (Chosen to last
>>> long enough to allow "i.6" to be entered.)
>>>
>>>   2!:1 'afplay ~/wav/test6s.wav &'
>>>   i.6
>>> 0 1 2 3 4 5
>>>
>>> The jijx accepts i.6 but hangs until test6s.wav finishes playing. Only
>>> then does 0 1 2 3 4 5 appear.
>>>
>>>   JVERSION
>>> Engine: j701/2011-01-10/11:25 build: Feb  6 2011 16:16:29
>>> Library: 7.01.055
>>> Platform: Darwin 64
>>> Installer: j701a_mac64.dmg
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to