Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to output only the latest screen with php exec?
    primarykey
    data
    text
    <p>My problem is: </p> <p>I have large output files generated with the exec command. I have about 800-1500 MB of text output, because it's appended to my text file every second. How could I only write the last piece of data to my text file?</p> <p>This is how I'm doing it now:</p> <pre><code>$cmd = 'btdownloadheadless --saveas /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/'.$kovNev.'/ '.$_REQUEST["torrent"]; exec(sprintf("%s &gt; %s 2&gt;&amp;1 &amp; echo $! &gt;&gt; %s", $cmd, $outputfile, $pidfile)); </code></pre> <p>I would like to see this in my output file:</p> <pre><code>saving: Test torrent (1115.9 MB) percent done: 19.8 time left: 22 min 04 sec download to: /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/uid1_fil_1370552248/ download rate: 1344.1 kB/s upload rate: 115.7 kB/s share rating: 0.121 (26.8 MB up / 221.3 MB down) seed status: 81 seen now, plus 3.994 distributed copies peer status: 18 seen now, 45.3% done at 2175.4 kB/s </code></pre> <p>And not this:</p> <pre><code>saving: Test torrent (1115.9 MB) percent done: 19.8 time left: 22 min 04 sec download to: /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/uid1_fil_1370552248/ download rate: 1344.1 kB/s upload rate: 115.7 kB/s share rating: 0.121 (26.8 MB up / 221.3 MB down) seed status: 81 seen now, plus 3.994 distributed copies peer status: 18 seen now, 45.3% done at 2175.4 kB/s saving: Test torrent (1115.9 MB) percent done: 19.8 time left: 22 min 04 sec download to: /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/uid1_fil_1370552248/ download rate: 1344.1 kB/s upload rate: 115.7 kB/s share rating: 0.121 (26.8 MB up / 221.3 MB down) seed status: 81 seen now, plus 3.994 distributed copies peer status: 18 seen now, 45.3% done at 2175.4 kB/s saving: Test torrent (1115.9 MB) percent done: 19.8 time left: 22 min 04 sec download to: /var/www/virtual/tigyisolutions.hu/boxy/htdocs/downloaded_torrent/uid1_fil_1370552248/ download rate: 1344.1 kB/s upload rate: 115.7 kB/s share rating: 0.121 (26.8 MB up / 221.3 MB down) seed status: 81 seen now, plus 3.994 distributed copies peer status: 18 seen now, 45.3% done at 2175.4 kB/s ...etc... </code></pre> <p>So I would like to see only the latest screen. My bash command append the output txt an not rewriting it. I want to rewrite it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload