octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #31895] error: run: file must exist and be a v


From: Ben Abbott
Subject: [Octave-bug-tracker] [bug #31895] error: run: file must exist and be a valid Octave script file
Date: Fri, 17 Dec 2010 01:20:47 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.231 Safari/534.10

Follow-up Comment #2, bug #31895 (project octave):

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 ...


mfile = "test.m";
if (exist (strcat (pwd, filesep, mfile, "file")))
  delete (mfile)
endif
fid = fopen (mfile, "w");
fprintf (fid, "x = 0:0.1:10;n")
fprintf (fid, "plot (x, sin(x), x, cos(x))")
fclose (fid);
eval (mfile(1:end-2))


I get the error below.


error: Invalid call to test.  Correct usage is:

 -- Function File:  test NAME
 -- Function File:  test NAME quiet|normal|verbose
 -- Function File:  test ('NAME', 'quiet|normal|verbose', FID)
 -- Function File:  test ([], 'explain', FID)
 -- Function File: SUCCESS = test (...)
 -- Function File: [N, MAX] = test (...)
 -- Function File: [CODE, IDX] = test ('NAME','grabdemo')


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

Perhaps the error handling should rely upon lasterror?


[msg, msgid] = lasterr;
error (msgid, msg)



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31895>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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