This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: mkstemp bug
> * Christopher Faylor <pts-ab-crefbany-ercyl-cyrnfr@pltjva.pbz> [2005-04-27 18:20:31 -0400]:
>
> On Wed, Apr 27, 2005 at 06:06:09PM -0400, Sam Steingold wrote:
>>> * Sam Steingold <fqf@tah.bet> [2005-04-27 13:24:29 -0400]:
>>>
>>> it appears that mkstemp() returns a temp FD pointing to the same file:
>>> mkstemp ("/tmp/clisp-x-io-XXXXXX");
>>> ==> "/tmp/clisp-x-io-000592"
>>> mkstemp ("/tmp/clisp-x-io-XXXXXX");
>>> ==> "/tmp/clisp-x-io-000592"
>>> mkstemp ("/tmp/clisp-x-io-XXXXXX");
>>> ==> "/tmp/clisp-x-io-000592"
>>
>>this is note quite as easy to reproduce. sorry.
>>
>>the problem is that mkstemp() does not regard FIFOs (as created by
>>mkfifo() or mknod()) as existing files.
>>
>>e.g.
>>
>> char s1[] = "/tmp/foo-XXXXXX";
>> char s2[] = "/tmp/foo-XXXXXX";
>> int fd = mkstemp(s1);
>> close(fd); remove(s1);
>> mkfifo(s1,0644);
>> mkstemp(s2);
>> strcmp(s1,s2) ===> 0
>
> fifos just barely work under cygwin. I wouldn't recommend using them.
Yes, it appears that they are heavily broken. Try
mkfifo foo
xterm -e 'tty >> foo; cat foo'
(now foo can be used by other tty application to communicate with the
user via the dedicated xterm - works in linux but not cygwin).
nevertheless, mkstemp() breakage is also a problem here.
thanks for your reply.
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://pmw.org.il/> <http://www.honestreporting.com> <http://ffii.org/>
<http://www.jihadwatch.org/> <http://www.dhimmi.com/> <http://www.camera.org>
Ernqvat guvf ivbyngrf QZPN.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/