|
From: | Aditya Bhagwat |
Subject: | Re: fprintf doesn't write "hello" to temporary file |
Date: | Fri, 23 Oct 2009 16:31:01 +0200 |
User-agent: | Thunderbird 2.0.0.23 (X11/20090817) |
Dear all,
I found the problem. The code is actually working, I only shouldn't be using the 'cat' function. The cat function is meant to concatenate vectors in octave, I mistakenly took it for the linux cat function to display the contents of a file.fileName = sprintf('%s.sh', tmpnam()); fid = fopen(fileName, "w"); fprintf(fid, "hello\n"); fclose(fid); cat(fileName)For some reason the file remains empty and no "hello" is present in it. Any idea what is happening here?I should add that I am working on octave 3.2.3, compiled on Ubuntu 9.04. I am calling octave from within emacs 23.1.
Regards, Aditya
[Prev in Thread] | Current Thread | [Next in Thread] |