<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#330000">
    hi<br>
    <br>
    you can use deletefile(filename); before write (filename,string);<br>
    <br>
    deltefile will not mind if filename does not exist, so this will
    work without checking before <br>
    <br>
    with old scilab versions, you can use unix("rm "+filename) or
    unix("del "+filename)<br>
    <br>
    <br>
    for more sophisticated things, such as appending something to a
    file, see mopen<br>
    <br>
    On 06/07/2011 22:18, lukeaarond wrote:
    <blockquote cite="mid:1309983518996-3146073.post@n3.nabble.com"
      type="cite">
      <pre wrap="">I am saving a string with the function write:

write('name.txt',string);

However, if there is already a file called 'name.txt' in the directory then
the write() function stops and will not save the string. How do I get
write() to overwrite files?

--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/overwriting-files-with-write-tp3146073p3146073.html">http://mailinglists.scilab.org/overwriting-files-with-write-tp3146073p3146073.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
</pre>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <p style="color: teal; font-size: 12pt;"><b>Adrien Vogt-Schilb</b><br>
        Research Fellow<br>
        <a class="moz-txt-link-abbreviated" href="mailto:vogt@centre-cired.fr">vogt@centre-cired.fr</a><br>
        Tel: (+33) 1 43 94 73 96<br>
        Fax: (+33) 1 43 94 73 70<br>
      </p>
      <table style="border: medium none;">
        <tbody>
          <tr>
            <td style="padding: 0pt;">
              <p><img src="cid:part1.04030102.06040809@centre-cired.fr"
                  alt="CIRED" width="54"></p>
            </td>
            <td style="padding: 0pt 7pt;" valign="middle">
              <p style="font-size: 10pt; color: teal;">45 bis, Av de la
                Belle Gabrielle<br>
                F-94736 Nogent-sur-Marne<br>
                <a href="http://www.centre-cired.fr/" style="color:
                  teal;">http://www.centre-cired.fr/</a><br>
              </p>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>