<div dir="ltr"><div>Hi Antoine</div><div><br></div><div>isfile() looks like exactly what I wish for. I suppose then, this is the correct ("most official") way to do it in Scilab.</div><div><br></div><div>Thanks!</div><div><br></div><div>Best regards,</div><div>Claus</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 25, 2018 at 7:40 PM, Antoine ELIAS <span dir="ltr"><<a href="mailto:antoine.elias@scilab-enterprises.com" target="_blank">antoine.elias@scilab-enterprises.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello Claus,<br>
    <br>
    You can use "isfile" function to check existence if a file and
    "isdir" for folder.<br>
    <a class="m_-8588640749867220623moz-txt-link-freetext" href="https://help.scilab.org/docs/6.0.0/en_US/isfile.html" target="_blank">https://help.scilab.org/docs/<wbr>6.0.0/en_US/isfile.html</a><br>
    <a class="m_-8588640749867220623moz-txt-link-freetext" href="https://help.scilab.org/docs/6.0.0/en_US/isfile.html" target="_blank">https://help.scilab.org/docs/<wbr>6.0.0/en_US/isdir.html</a><br>
    <br>
    Regards,<br>
    Antoine<div><div class="h5"><br>
    <div class="m_-8588640749867220623moz-cite-prefix">Le 25/01/2018 à 17:43, Claus Futtrup a
      écrit :<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>Dear Scilabers</div>
        <div><br>
        </div>
        <div>I wish to check for the existence of some files. For this I
          created a simple function:</div>
        <div><br>
        </div>
        <div>
          <pre style="font-family:Monospaced;font-size:14px;font-style:normal"><span style="color:rgb(74,85,219)">[</span><span style="color:rgb(0,0,0)">out</span><span style="color:rgb(74,85,219)">]</span><span style="color:rgb(92,92,92)">=</span><span style="color:rgb(176,24,19)">function</span> <span style="color:rgb(0,0,0);text-decoration:underline">file_exist</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(131,67,16);font-weight:bold">fname</span><span style="color:rgb(74,85,219)">)</span>
    <span style="color:rgb(74,85,219)">[</span><span style="color:rgb(0,0,0)">fd</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(0,0,0)">err</span><span style="color:rgb(74,85,219)">]</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(50,185,185)">mopen</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(131,67,16);font-weight:bold">fname</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">// Try to open file, mode: </span><span style="color:rgb(100,174,100);font-style:italic">'</span><span style="color:rgb(100,174,100);font-style:italic">br</span><span style="color:rgb(100,174,100);font-style:italic">'</span><span style="color:rgb(100,174,100);font-style:italic"> (binary-reading)</span>
    <span style="color:rgb(160,32,240)">if</span> <span style="color:rgb(0,0,0)">err</span><span style="color:rgb(92,92,92)">==</span><span style="color:rgb(188,143,143)">0</span> <span style="color:rgb(160,32,240)">then</span>
        <span style="color:rgb(0,0,0)">out</span><span style="color:rgb(92,92,92)">=</span><span style="color:rgb(218,112,214)">%t</span><span style="color:rgb(0,0,0)">;</span>
        <span style="color:rgb(50,185,185)">mclose</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(131,67,16);font-weight:bold">fname</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
    <span style="color:rgb(160,32,240)">else</span>
        <span style="color:rgb(0,0,0)">out</span><span style="color:rgb(92,92,92)">=</span><span style="color:rgb(218,112,214)">%f</span>
    <span style="color:rgb(160,32,240)">end</span>
<span style="color:rgb(176,24,19)">endfunction</span></pre>
        </div>
        <div><br>
        </div>
        <div>I didn't check, but presumably this would work.</div>
        <div><br>
        </div>
        <div>Is such a function already available? Which way is the
          "official" way to do this in Scilab?</div>
        <div><br>
        </div>
        <div>Maybe I'm searching for the wrong word, but I found some
          ways in Scilab. The "fileinfo" seems to be the closest one to
          what I wish to do.</div>
        <div><br>
        </div>
        <div>Matlab has a function "exist()" which can check for files
          too. Scilab has the function "exists()" - notice the function
          name is plural, not singluar - and this one AFAIK only works
          for Scilab variables (not files), although I didn't check.</div>
        <div><br>
        </div>
        <div>If fileinfo is the right way, maybe an example for the help
          could be to make a file_exist function, to show ... (?)
          ... when I search for Scilab file exist function, I'm not
          guided in any specific way/direction and find myself insecure
          whether I find the right help.</div>
        <div><br>
        </div>
        <div>Best regards,</div>
        <div>Claus<br>
        </div>
      </div>
      <br>
      <fieldset class="m_-8588640749867220623mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><span><pre>______________________________<wbr>_________________
users mailing list
<a class="m_-8588640749867220623moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a class="m_-8588640749867220623moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/<wbr>mailman/listinfo/users</a>
</pre>
    </span></blockquote>
    <br>
  </div>

<br>______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank" rel="noreferrer">http://lists.scilab.org/<wbr>mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>