Ocean script fprintf error

Status
Not open for further replies.

samiran_dam

Full Member level 2
Joined
Apr 17, 2010
Messages
122
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,419
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.

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?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…