From owner-help-octave at bevo dot che dot wisc dot edu Tue Jan 9 23:45:26 1996 Subject: duplicated file descriptor - patch available please? From: Joao Cardoso To: help-octave at bevo dot che dot wisc dot edu Date: Wed, 10 Jan 96 06:39:34 +0100 Hi, is it possible to get a fast patch to solve this problem? Please? I would apreciate it very much, as it is very inconveniente to me (at least) as I keep several open files in my scripts. Thanks, Joao PS: Below I enclose the original post reporting the bug. Hi, Octave returns a duplicated file descriptor, equal to the highest one, if an intermediate file descritor is first closed. Take a look: Octave, version 1.1.1. Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton. This is free software with ABSOLUTELY NO WARRANTY. For details, type `warranty'. octave:1> c=fopen(octave_tmp_file_name ,"w") c = 4 octave:2> c=fopen(octave_tmp_file_name ,"w") d = 5 octave:3> d=fopen(octave_tmp_file_name ,"w") e = 6 octave:4> freport number mode name 0 r stdin 1 w stdout 2 w stderr 4 w /usr/tmp/oct-AAAa22912 5 w /usr/tmp/oct-BAAa22912 6 w /usr/tmp/oct-CAAa22912 octave:5> fclose(d) ans = 1 octave:6> freport number mode name 0 r stdin 1 w stdout 2 w stderr 4 w /usr/tmp/oct-AAAa22912 6 w /usr/tmp/oct-CAAa22912 octave:7> d=fopen(octave_tmp_file_name ,"w") d = 6 octave:8> freport number mode name 0 r stdin 1 w stdout 2 w stderr 4 w /usr/tmp/oct-AAAa22912 6 w /usr/tmp/oct-CAAa22912 6 w /usr/tmp/oct-DAAa22912 octave:9> quit Bye, Joao -- Joao Cardoso, INESC | e-mail: jcard at zorg dot tecno dot inescn dot pt R. Jose Falcao 110 | tel: + 351 2 2094345 4000 PORTO, PORTUGAL | fax: + 351 2 2008487