octave-maintainers
[Top][All Lists]
Advanced

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

Re: new function: textscan.m


From: Ben Abbott
Subject: Re: new function: textscan.m
Date: Sat, 23 Oct 2010 13:30:19 +0800

On Oct 23, 2010, at 9:56 AM, John W. Eaton wrote:

> On 23-Oct-2010, Ben Abbott wrote:
> 
> | Regarding a is_valid_file_id() function, I like the idea. Can this
> | be done as an m-file? 
> 
> We could check that a value is a scalar integer >= 0 in a .m file.
> But would it also be useful to know whether the file ID refers to an
> open file?  If so, then I think the function will have to be built
> in, and it should be pretty easy to add something to the
> octave_stream_list class to do the work.  Or should we allow invalid
> file IDs and just wait for reading/writing to fail?
> 
> jwe


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.

Ben


reply via email to

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