[scilab-Users] Scilab equivalent of mfilename?

Samuel Gougeon sgougeon at free.fr
Tue Nov 15 03:23:10 CET 2011


Le 15/11/2011 01:21, Iai Masafumi ax a e'crit :
> Hi
>
> Does Scilab have a command like mfilename in Matlab? I want to get the
> name of a currently running script file.
>   
If you really don't know the name of the current script, you may use the
following:

[u,t,n]=file();
i = grep(n',"/(?:.*\.sci|.*\.sce)$/","r");
p = n(i(1))
// and if you need only the script name without its path nor the file
extension:
basename(p)

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20111115/3c03e1c6/attachment.htm>


More information about the users mailing list