<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Scilabers</p>
    <p>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:</p>
    <pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(100,174,100);font-style:italic;">// Extract the filename and path of this script:</span>
<span style="color:rgb(74,85,219);">[</span><span style="color:rgb(0,0,0);">units</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">typs</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">nams</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">file</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(100,174,100);font-style:italic;">// nams(1) = script file name incl. path</span>
<span style="color:rgb(0,0,0);">fpathname</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">strsplit</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">nams</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(50,185,185);">filesep</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span> <span style="color:rgb(100,174,100);font-style:italic;">// disp(b($-1));</span>
<span style="color:rgb(0,0,0);">scriptpath</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">get_absolute_file_path</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">fpathname</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(255,170,0);">$</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(50,185,185);">chdir</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">scriptpath</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span></pre>
    <p>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?<br>
    </p>
    <p>/Claus<br>
    </p>
  <div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
        <tr>
        <td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
                <td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
                </td>
        </tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>