'fopen' successfully opens directories

Sergei Steshenko sergstesh at yahoo.com
Thu Apr 24 01:17:12 CDT 2008


--- "John W. Eaton" <jwe at bevo.che.wisc.edu> wrote:

> On 23-Apr-2008, Sergei Steshenko wrote:
> 
> | Which file implements 'fopen' in 'octave' ? And which function(s) in it ?
> 
> Look in src/file-io.cc.  Make the change in do_stream_open function.
> Take advantage of the file_stat class from liboctave.
> 
> jwe
> 

Please find a patch attached, it was produced using this command:

diff -Naur octave-3.0.1/src/file-io.cc.original octave-3.0.1/src/file-io.cc >
warning_on_fopen_on_dir.patch
.

With the patch 'fopen' works this way:

"
octave:1> fid = fopen("/tmp", "r")
warning: fopen: '/tmp' file to be opened is actually a directory, most likely the returned FID
will be useless
fid =  3
".

Thanks,
  Sergei.

Applications From Scratch: http://appsfromscratch.berlios.de/


      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: warning_on_fopen_on_dir.patch
Type: text/x-diff
Size: 574 bytes
Desc: 2464151257-warning_on_fopen_on_dir.patch
Url : https://www.cae.wisc.edu/pipermail/bug-octave/attachments/20080423/09b631fa/attachment-0001.bin 


More information about the Bug-octave mailing list