[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #47807] run behaves differently from Matlab on
From: |
Julien Bect |
Subject: |
[Octave-bug-tracker] [bug #47807] run behaves differently from Matlab on function m-files |
Date: |
Mon, 16 May 2016 17:06:40 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 |
Follow-up Comment #8, bug #47807 (project octave):
I wrote below that "Matlab changes directory in all cases", and this indeed
what the documentation of Matlab R2016a says (currently online at:
http://fr.mathworks.com/help/matlab/ref/run.html).
Unfortunately, it seems that the truth is more complicated (arghhhhh). Here is
the output of the attached example script in Matlab R2016a:
=== Calling mfunc directly ===
myfunc has been called with 0 argins
current directory is: /home/bect/code/octave/bugs/47807/essai1
myfunc has been called with 2 argins
current directory is: /home/bect/code/octave/bugs/47807/essai1
=== Calling mfunc with run ===
myfunc has been called with 0 argins
current directory is: /home/bect/code/octave/bugs/47807/essai1/subdir
myfunc has been called with 0 argins
current directory is: /home/bect/code/octave/bugs/47807/essai1/subdir
myfunc has been called with 0 argins
current directory is: /home/bect/code/octave/bugs/47807/essai1
myfunc has been called with 0 argins
current directory is: /home/bect/code/octave/bugs/47807/essai1
It seems that Matlab actually changes directory in all cases but one: it
doesn't change directory when the input argument has no "path part" (the first
output arg of fileparts is empty).
This is easy to implement,
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47807>
_______________________________________________
Message posté via/par Savannah
http://savannah.gnu.org/