# HG changeset patch # User Eugenio Gianniti # Date 1400688965 -7200 # Node ID 8b159045242ff7ffbbcae294c4438d62e265845b # Parent 6671cb83a2dd2df5ffd42e17844ab32e4e7e70d7 ufl errors out if filename exists when start command is issued diff -r 6671cb83a2dd -r 8b159045242f inst/ufl.m --- a/inst/ufl.m Wed May 21 17:56:22 2014 +0200 +++ b/inst/ufl.m Wed May 21 18:16:05 2014 +0200 @@ -46,7 +46,12 @@ filename = [filename, ".ufl"]; endif endif - fid = fopen (filename, "w"); + [~, err, ~] = stat (filename); + if (err == 0) + error (["ufl: a file named ", filename, " already exists"]); + else + fid = fopen (filename, "w"); + endif endif if (! is_valid_file_id (fid)) error (["ufl: could not open file ", filename]);