[scilab-Users] overwriting files with write()

Adrien Vogt-Schilb vogt at centre-cired.fr
Wed Jul 6 22:27:29 CEST 2011


hi

you can use deletefile(filename); before write (filename,string);

deltefile will not mind if filename does not exist, so this will work 
without checking before

with old scilab versions, you can use unix("rm "+filename) or unix("del 
"+filename)


for more sophisticated things, such as appending something to a file, 
see mopen

On 06/07/2011 22:18, lukeaarond wrote:
> 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: http://mailinglists.scilab.org/overwriting-files-with-write-tp3146073p3146073.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.


-- 

*Adrien Vogt-Schilb*
Research Fellow
vogt at centre-cired.fr
Tel: (+33) 1 43 94 73 96
Fax: (+33) 1 43 94 73 70

CIRED

	

45 bis, Av de la Belle Gabrielle
F-94736 Nogent-sur-Marne
http://www.centre-cired.fr/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110706/ebb93a69/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logocired.png
Type: image/png
Size: 4092 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20110706/ebb93a69/attachment.png>


More information about the users mailing list