bugGNU Octave - Bugs: bug #39922, type () fails to display the...

 
 

bug #39922: type () fails to display the content of an ASCII file with no extension

Submitter:  Julien Bect <jbect>
Submitted:  Mon 02 Sep 2013 08:32:17 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Julien Bect Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 10 Sep 2013 03:23:11 AM UTC, comment #3: 

I fixed this on the development branch in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/a1fa416c7c4a).  I also clarified the documentation to note that 'type' works on ordinary files, variables, operators, keywords, and not just m-files.

Rik <rik5>
Group administrator
Fri 06 Sep 2013 02:25:26 PM UTC, comment #2: 

I confirm that type displays the content of the file if I rename it to README.txt instead of README.

According to the documentation, however, nothing should be displayed since README.txt is not a function:


'type' is a function from the file /usr/share/octave/3.6.4/m/help/type.m

 -- Command:  type NAME ...
 -- Command:  type -q NAME ...
 -- Function File: dfns = type ("NAME", ...)
     Display the definition of each NAME that refers to a function.

     Normally also displays whether each NAME is user-defined or
     built-in; the `-q' option suppresses this behavior.

     If an output argument is requested nothing is displayed.  Instead,
     a cell array of strings is returned, where each element
     corresponds to the definition of each requested function.


Julien Bect <jbect>
Wed 04 Sep 2013 01:38:39 AM UTC, comment #1: 

Semi-confirmed. Type in Octave will actually display the content of files as long as they have a . in their name, so for example README.txt should work but README doesn't work.

From inside the Octave build tree:


octave:7> type AUTHORS
error: type: 'AUTHORS' undefined
octave:7> type BUGS
error: type: 'BUGS' undefined
octave:7> type INSTALL.OCTAVE
INSTALL.OCTAVE is the user-defined function defined from: ./INSTALL.OCTAVE

This file documents the installation of Octave.

   Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation.


Mike Miller <mtmiller>
Group Member
Mon 02 Sep 2013 08:32:17 AM UTC, original submission:  

In Octave, type () fails to display the content of an ASCII file that is not an m-file.


octave:1> type README
error: type: 'README' undefined


In Matlab, on the other hand:


>> type README
This is the content of README !!!


It seems that the intended role of type () is thus quite different in Matlab (where it simply displays the content of ANY ascii file) and in Octave.

Julien Bect <jbect>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by jbect (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-10 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2013-09-04 mtmiller StatusNone Confirmed
        Operating SystemGNU/Linux Any
        Summarytype () fails to display the content of an ASCII file that is not an m-file type () fails to display the content of an ASCII file with no extension

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code