From bug-octave-request at bevo dot che dot wisc dot edu Fri Oct 20 05:41:40 1995 Subject: duplicated file descriptor From: Joao Cardoso To: bug-octave at bevo dot che dot wisc dot edu Date: Fri, 20 Oct 1995 09:53:42 +0100 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 | e-mail: jcardoso at bart dot inescn dot pt INESC, R. Jose Falcao 110 | tel: + 351 2 2094345 4000 PORTO, PORTUGAL | fax: + 351 2 2008487