help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fprintf doesn't write "hello" to temporary file


From: Aditya Bhagwat
Subject: fprintf doesn't write "hello" to temporary file
Date: Fri, 23 Oct 2009 15:42:24 +0200
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Dear all,

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?

Regards and many thanks for your help,

Aditya



Send Help-octave mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Help-octave digest..."


Today's Topics:

   1. Installing packages "java" and "jhandles" (Yuri Belenky)
   2. Re: enabling immediate output behavior (Aditya Bhagwat)
   3. parcellfun example code snippet? (Michael Creel)
   4. Re: enabling immediate output behavior (Francesco Potort?)
   5. plot titles are off of the plot (charles reid)


----------------------------------------------------------------------

Message: 1
Date: Fri, 23 Oct 2009 07:46:23 +0200
From: Yuri Belenky <address@hidden>
Subject: Installing packages "java" and "jhandles"
To: address@hidden
Message-ID:
        <address@hidden>
Content-Type: text/plain; charset="iso-8859-1"

Trying to install packages "java" and "jhandles" on top of Octave 3.2.2
running under Windows XP with no success. The Java SDK installed in
directory "C:\Program Files\Java\jdk1.6.0_16" so I've set respective
"JAVA_HOME" environment. Also set "JAVA_INCS" variable as "-IC:/Program
\Files/Java/jdk1.6.0_16/include -IC:/Program
\Files/Java/jdk1.6.0_16/include/win32" as recommended in some forums. The
Octave is in "C:\Octave\...". When running "pkg install" command compiler
reports that Java development kit cannot be found.
Help is appreciated.
Yuri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www-old.cae.wisc.edu/pipermail/help-octave/attachments/20091023/d6d29fc2/attachment-0001.html
------------------------------

Message: 2
Date: Fri, 23 Oct 2009 09:25:37 +0200
From: Aditya Bhagwat <address@hidden>
Subject: Re: enabling immediate output behavior
To: Francesco Potort? <address@hidden>
Cc: address@hidden
Message-ID: <address@hidden>
Content-Type: text/plain; charset=UTF-8; format=flowed

Dear Francesco,

Thanks for your involvement.
Thanks for your help. Even while using disp(a) as you suggested, in the Emacs editor's inferior octave process, all output is kept till the last function evaluation has been performed, and only then sent to the screen.
Hm.  I run octave as an Emacs inferior process, though in a different
op.sys. (Debian).  If I run this:

octave> for i=1:50000 i=i+1; if (mod(i,10000)==0) disp(i); endif; endfor

I get this:

 10000
 20000
 30000
 40000
 50000
octave>
where the lines are printed at intervals of about one second's time.
Would you try my example above and let us know what happens?

In my case, for a couple of seconds, nothing happens. Then, the lines are printed all at once in the inferior octave window. I am working on emacs 23.1, which I compiled on Ubuntu 9.04.

Regards,

Aditya



------------------------------

Message: 3
Date: Fri, 23 Oct 2009 10:00:12 +0200
From: Michael Creel <address@hidden>
Subject: parcellfun example code snippet?
To: help <address@hidden>
Message-ID:
        <address@hidden>
Content-Type: text/plain; charset=ISO-8859-1

I have been trying out parcellfun on 3.0.1 and 3.3.50+ and I'm not
having luck. For example, if I try
[a b] = parcellfun(2, @sin, {1}, {2}) I expect that a and b should
hold sin(a) and sin(b). However, they are empty. So a working snippet
would be welcome to see how this is supposed to go.
Thanks, Michael


------------------------------

Message: 4
Date: Fri, 23 Oct 2009 13:24:36 +0200
From: Francesco Potort? <address@hidden>
Subject: Re: enabling immediate output behavior
To: Aditya Bhagwat <address@hidden>
Cc: address@hidden
Message-ID: <address@hidden>
Content-Type: text/plain; charset=utf-8

In my case, for a couple of seconds, nothing happens. Then, the lines are printed all at once in the inferior octave window. I am working on emacs 23.1, which I compiled on Ubuntu 9.04.

Allright, try this:

octave> more off
octave> for i=1:20000 i=i+1; if (mod(i,4000)==0) disp(i); endif; endfor

And look at what happens




reply via email to

[Prev in Thread] Current Thread [Next in Thread]