fopen doesn't return when opening a fifo!!
Ben Abbott
bpabbott at mac.com
Mon Mar 31 09:11:05 CDT 2008
On Mar 31, 2008, at 9:49 AM, Ben Abbott wrote:
>
> On Mar 31, 2008, at 9:15 AM, David Bateman wrote:
>> The following code fragment fails for me on Octave 3.0.x and 3.1.x
>>
>> tn = tmpnam ();
>> ## 6*8*8 = 0600 mode
>> [err, msg] = mkfifo(tn, 6*8*8)
>> gpin = fopen (tn, "r");
>> fclose (gpin);
>> unlink (tn);
>>
>> as the fopen on the fifo does not return. I originally thought this
>> might be an issue with my libc on my 64-bit system, but the same
>> occurs
>> on an old 32-bit system. Do others see the same bug? Anyone know
>> what is
>> going on?
>>
>> D.
>
> Yes I see the same, and my activity monitor indicates Octave is idle.
>
> eval (sprintf ('ls -l %s', tn))
prw------- 1 bpabbott wheel 0 2008-03-31 09:44 /var/tmp/oct-Z5XKZQ
hmmm ... that's not what I expected to see.
> ls -l /var/tmp/oct-*
prw------- 1 bpabbott wheel 0 2008-03-31 09:43 /var/tmp/oct-9DVwxT
prw------- 1 bpabbott wheel 0 2008-03-31 09:44 /var/tmp/oct-Z5XKZQ
-rw-r--r-- 1 root wheel 0 2007-11-24 22:25 /var/tmp/oct-p0PLLi
-rw-r--r-- 1 root wheel 0 2007-12-02 22:47 /var/tmp/oct-pqjfGX
[snip]
*My* temporary oct-files prior to Dec 2 have different permissions (I
have no idea when the binary that produced them was built). In any
event, it looks like the permissions have changed.
A quick search of src/ChangeLog, turns up this.
2172 2007-11-02 John W. Eaton <jwe at octave.org>
2173
2174 * file-io.cc (fopen_mode_to_ios_mode): Use
std::ios::app instead
2175 of std::ios::ate.
I have no idea if this is even relevant, but since I'm stuck at home
waiting on a tow truck :-( ... I thought I'd poke around.
Ben
More information about the Bug-octave
mailing list