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

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

[Octave-bug-tracker] [bug #40319] deleting script file in a function/scr


From: Pantxo Diribarne
Subject: [Octave-bug-tracker] [bug #40319] deleting script file in a function/script doesn't update the symbol table
Date: Sun, 27 Apr 2014 19:26:01 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0

Follow-up Comment #8, bug #40319 (project octave):

I ran the attached testdelete2.m (besides base.m) in Matlab in order to see
how Matlab handles the case of file deletion/modification. 

Basically there are too functions "foo.m" and "foo/foo.m" in the loadpath
(they print their mfilename). The first in the path ("foo.m") is deleted or
modified:


 * Deleting 'foo.m' before 'which ('foo')' returns
/home/pantxo/media/dev/octavewrk/bugdelete/foo/foo.m

 * Deleting 'foo.m' before 'exist ('foo.m', 'file')' returns
ans =
     2

 * Deleting 'foo.m' before 'run ('foo')' returns
ans =
/home/pantxo/media/dev/octavewrk/bugdelete/foo/foo

 * Deleting 'foo.m' before bare 'foo' returns
Previously accessible file "/home/pantxo/media/dev/octavewrk/bugdelete/foo.m"
is now inaccessible.

 * Modifying 'foo.m' before bare 'foo' returns
ans =
/home/pantxo/media/dev/octavewrk/bugdelete/foo
modified


It shows that:
* matlab rehashes prior to search in "run", "which" or "exist". * if a file
"foo.m" has been deleted since the last rehash, trying to run it using bare
"foo" leads to an error (as in octave) even if another "foo.m" exits in the
path.
* I was wrong in comment #7 about octave behavior in case of file
modification: the modified file is parsed in octave as in matlab 


The attached simple patch brings octave in line with matlab except that the
latters's message (in case of bare call "foo") is more explicit about the
origin of the error.  


(file #31260, file #31261, file #31262)
    _______________________________________________________

Additional Item Attachment:

File name: delete_exist.patch             Size:1 KB
File name: base.m                         Size:0 KB
File name: testdelete2.m                  Size:1 KB


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message posté via/par Savannah
  http://savannah.gnu.org/




reply via email to

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