help-octave
[Top][All Lists]
Advanced

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

fgets difference octave to c


From: uwedamm
Subject: fgets difference octave to c
Date: Fri, 22 Feb 2019 06:28:44 -0600 (CST)

Hello,
I try to read data from a text-file using fopen/fgets, which is written in
some other process.
If I do that in c, data, which is written by the other process can be read:
while(1)
{
    if(fgets(buf,100,fp))
        printf("%s\n",buf);
}

If I do that in octave, only data which was written before starting the
octave script is read, after that no new data is available and the fgets
continuously returns -1:
while (1)
    ln=fgets(fd,100);
    if(ln ~= -1)
        disp(ln);
        fflush(stdout);
    end
end

How can I proceed to continuously read data from the other process (like
e.g. in tail)?
thank you for support
Uwe





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

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