bugGNU Octave - Bugs: bug #31895, error: run: file must exist and be...

 
 

bug #31895: error: run: file must exist and be a valid Octave script file

Submitted by:  Rick T <ratulloch>
Submitted on:  Wed 15 Dec 2010 10:51:28 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Rick TOpen/Closed: Closed
Release: 3.2.3Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 06 Jan 2011 08:28:33 AM UTC, comment #5:

I think this problem has been fixed, so I'm closing this report. If that's not correct, then reopen it or create a new bug report.

John W. Eaton <jwe>
Project Administrator
Mon 20 Dec 2010 01:22:53 PM UTC, comment #4:

Yes. Before applying your patch, using "source (mfile)" works for me.

Ben Abbott <bpabbott>
Project Member
Mon 20 Dec 2010 03:41:15 AM UTC, comment #3:

Ben, does it work if you use

instead of

?

I changed the run function to use source instead of just evaluating the name of the script without the file extension:

http://hg.savannah.gnu.org/hgweb/octave/rev/0754a4e271f4

I don't know whether that will solve the original problem, but it seems like the correct thing for run to do based on its docstring.

John W. Eaton <jwe>
Project Administrator
Fri 17 Dec 2010 01:20:47 AM UTC, comment #2:

Looks like the error given by run.m is making an improper inference as to what is wrong.

If the example below is run as a script ...

I get the error below.

If a "rehash" is added between "fclose(fid)" and "eval(...)", the script runs without error.

Perhaps the error handling should rely upon lasterror?

Ben Abbott <bpabbott>
Project Member
Thu 16 Dec 2010 06:37:46 AM UTC, comment #1:

Please provide a self-contained example that demonstrates the problem.

John W. Eaton <jwe>
Project Administrator
Wed 15 Dec 2010 10:51:28 PM UTC, original submission:

Greetings All

I get this error message when I try and run an m file that creates another m file with an equation in it.

Example: I use one m file to create another m file called test.m that has the equation in it "y=vert*sin(24);"
then I try and run it I get

>>> run('/home/rat/Documents/octave/eq_research/aa/test.m')

error: run: file must exist and be a valid Octave script file

>>>error: called from:

error: /usr/share/octave/3.2.3/m/miscellaneous/run.m at line 46, column 2

The m file does exist it is created using the fprintf(fid) commands. I notice that If I open the m file that is created (test.m) and add a space and delete the space then save it the command will work does anyone know of a better work around then opening each created m file. It's as though the file is created but it cant see it. Does anyone have a work around

here's my version

GNU Octave Version 3.2.3
GNU Octave License: GNU General Public License
Operating System: Linux 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 10:14:11 UT
C 2010 x86_64
----------------------------------------------------------------------
Package Name | Version | Installation directory
--------------+---------+-----------------------
audio *| 1.1.4 | /usr/share/octave/packages/3.2/audio-1.1.4
multicore *| 0.2.15 | /usr/share/octave/packages/3.2/multicore-0.2.15
time *| 1.0.9 | /usr/share/octave/packages/3.2/time-1.0.9

Rick T <ratulloch>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by ratulloch (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 06 Jan 2011 08:28:33 AM UTCjweStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Thu 16 Dec 2010 06:38:02 AM UTCjweStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1