[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to do equivalent of Linux 'tail' script into Octave variables?
From: |
Andreas Weber |
Subject: |
Re: How to do equivalent of Linux 'tail' script into Octave variables? |
Date: |
Sun, 22 Sep 2019 12:37:52 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
Am 22.09.19 um 06:41 schrieb Mark Smith:
> The instrument runs for hours, and creates a comma delimited ASCII data
> file, which has new data appended every second. Can't find a way to get
> incremental data that is added each second.
I use this approach:
Run this in a terminal to simulate your instrument:
$ watch -n1 sh -c "date >> foo"
And in GNU Octave:
fid = fopen ("foo", "r");
while (1)
l = fgetl (fid)
if (feof (fid))
printf ("eof, waiting 2s...\n");
pause (2);
fclear (fid);
endif
endwhile
fclose (fid);
HTH, Andy