samiran_dam
Full Member level 2
Hi All,
I had used ocean script a long time back. And I used it to quite an extent.
Recently, there is a need of using it again in one of my on-going projects. However, to my surprise I am stuck with a very preliminary function. I am trying to write some data in an external file. For that I am using outfile and fprintf commands. Although the file is created, there is nothing written inside the file.
There are only two lines in the sample file I have created for debugging this problem.
When I run the file (from <ocean> command prompt: load("sample_script.ocn")), there is no error thrown. But there is nothing written in the output_file.txt
What could be the reason?
I had used ocean script a long time back. And I used it to quite an extent.
Recently, there is a need of using it again in one of my on-going projects. However, to my surprise I am stuck with a very preliminary function. I am trying to write some data in an external file. For that I am using outfile and fprintf commands. Although the file is created, there is nothing written inside the file.
There are only two lines in the sample file I have created for debugging this problem.
Code:
fout=outfile("output_file.txt" "w")
fprintf(fout "Hello World\n")
When I run the file (from <ocean> command prompt: load("sample_script.ocn")), there is no error thrown. But there is nothing written in the output_file.txt
What could be the reason?