[Scilab-users] Fetching the script path
Claus Futtrup
cfuttrup at gmail.com
Sun Sep 30 20:59:58 CEST 2018
Hi Scilabers
I have almost always included a neat piece of code in my Scilab scripts,
so that I can later dump the plots into e.g. SVG or PNG files (script
path is not write-protected). The code doesn't work anymore:
// Extract the filename and path of this script:
[units,typs,nams]=file(); // nams(1) = script file name incl. path
fpathname=strsplit(nams(1), [filesep()]); // disp(b($-1));
scriptpath = get_absolute_file_path(fpathname($));
chdir(scriptpath);
The above code returns an empty string in scriptpath. I'm using Scilab
6.0.1 (Windows 10) and I wonder what I should do instead?
/Claus
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180930/ae3ea1b2/attachment.htm>
More information about the users
mailing list