octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new function: textscan.m


From: John W. Eaton
Subject: Re: new function: textscan.m
Date: Sat, 23 Oct 2010 01:47:29 -0400

On 23-Oct-2010, Ben Abbott wrote:

| I'd prefer that the function checks that the fid is attached to a file.
| 
| I just noticed that fopen() can do this ...
| 
|       [file, mode, arch] = fopen (fid);
| 
| That can be used to implement a m-file version.

Ah, good idea, I had forgotten about that feature.  I'll check in the
follwoing function:

  function retval = is_valid_file_id (fid)

    retval = false;

    if (nargin == 1)
      try
        [file, mode, arch] = fopen (fid);
        retval = ! isempty (file);
      end_try_catch
    else
      print_usage ();
    endif

  endfunction

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]