Hi,
I’m using Scilab 2024.0.0 on a Windows 10 machine.
If I execute the following code:
// Extract the filename and path of this script:
[units,typs,nams]=file(); // nams(1) = script file name incl. path
fpathname=strsplit(nams(1), [filesep()]);
scriptpath = get_absolute_file_path(fpathname($));
It cannot get the proper information. This means when I try to save a plot:
saveplot = %t;
if saveplot then
xs2png(gcf(),xs2png(gcf(),scriptpath + "" + “output.png”));
end
Then I get the following error in the Scilab console:
xs2png: Unable to create export file, permission denied.
In the past this used to work, but I admit now it doesn’t work in older Scilab releases, like 2023.0.0 or even Scilab 6.1.0, so maybe it’s a Windows issue.
The script is located in a user directory with write permissions. Maybe Scilab doesn’t have the user permissions?
Maybe today there is another preferred way?
With kind regards,
Claus