--u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Rob Biedenharn: > On Nov 22, 2008, at 8:18 PM, Shot (Piotr Szotkowski) wrote: >> I want to track the progress of a set of >> (forkoff) processes in a simple way. [¦Ý >> print '.' * 25; (0...25).sort_by{rand}.each { |n| print "\r"; print "\c[[C" * n; print 'o'; sleep 0.5 }; print "\n" > status='.'*25; print status; (0...25).sort_by{rand}.each{|n| status[n]='o'; > print "\r#{status}"; sleep(0.1+rand/10.0)};puts A very good idea, but unfortunately it doesn work in a forkoff block; every block gets its own copy of the original status and so generates a line with 24 dots and one o: shot@devielle:~$ irb -rubygems >> require 'forkoff' => true >> status='.'*25; print status; (0...25).sort_by{rand}.forkoff{|n| status[n]='o'; print "\r#{status}"; sleep(0.1+rand/10.0)};puts ..................o...... => nil Hence my need for a right arrow, or for printing a ransparentcharacter that doesn¡Çt overwrite what¡Çs already under the cursor. > You could, perhaps, add a clear-to-EOL sequence, too. I¡Çm sorry, but I¡Çm a bit braindead today; where would I want to use this? (And, when we¡Çre at it, what¡Çs the escape sentence for it?) Thanks a lot for your interest in this thread and your reply! -- Shot -- A distributed system is one in which I cannot get something done because a machine I've never heard of is down. -- Leslie Lamport --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFJKZXDi/mCfdEo8UoRAnK+AJ0c786HnPDfkv8EA+BwApiruZ8+ywCdF4EN TU6Vmwel8K6NYabfuCElti4 Sr -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--