Skip to content

Commit

Permalink
- Added append file API
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10712 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 14, 2011
1 parent c103c3e commit 0ff0d37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -948,6 +948,7 @@ function writeFile
"Write the data to file. Returns true on success."
input String fileName;
input String data;
input Boolean append := false;
output Boolean success;
external "builtin" annotation(__OpenModelica_Impure=true);
annotation(preferredView="text");
Expand Down
8 changes: 7 additions & 1 deletion Compiler/Script/CevalScript.mo
Expand Up @@ -1439,12 +1439,18 @@ algorithm
then
(cache,Values.STRING(str_1),st);

case (cache,env,"writeFile",{Values.STRING(str),Values.STRING(str1)},st,msg)
case (cache,env,"writeFile",{Values.STRING(str),Values.STRING(str1),Values.BOOL(false)},st,msg)
equation
System.writeFile(str,str1);
then
(cache,Values.BOOL(true),st);

case (cache,env,"writeFile",{Values.STRING(str),Values.STRING(str1),Values.BOOL(true)},st,msg)
equation
System.appendFile(str, str1);
then
(cache,Values.BOOL(true),st);

case (cache,env,"writeFile",_,st,msg)
then
(cache,Values.BOOL(false),st);
Expand Down

0 comments on commit 0ff0d37

Please sign in to comment.