🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #2061

Re: barra de progreso en consola?

#2061
From: Pascal Bourguignon
Date: Thu, 28 Apr 2005 22:50
28 lines
1656 bytes
c4y0 <c4y0@Source-ville.openl4b.biz> writes:

> Buenas las tengan!
>
> Como se puede crear una barra de progreso en consola asi como la que usa
> wget?
>
> me gustaria cambiar mis scripts de inicio para que pudieran mostrar una
> barra de progreso mientras cargan.
>
> Que informacion o enlaces me pueden facilitar?

#include <stdio.h>
void clean_progress(void){
  printf("\r%79s\r");}
void progress(int percent){
  printf("\r %3d ",percent)
  for(i=0;i<percent/2;i++){printf("=");}
  if(percent<100){printf(">\r");}else{printf("\r");}}
int main(void){
  int p;for(p=0;p<=100;p++){sleep(1);progress(p);}
  return(0);}


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

This is a signature virus.  Add me to your signature and help me to live
Technical Details
Message-ID: <87oebyjz1o.fsf@thalassa.informatimago.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!easynet-quince!easynet.net!easynet-post2!not-for-mail
References: <slrnd72b9v.mkm.c4y0@poseidon.antivirusysoluciones.com.co>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,d17174945d792d76
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!easynet-quince!easynet.net!easynet-post2!not-for-mail
Newsgroups: es.comp.os.linux.programacion
Subject: Re: barra de progreso en  consola?
References: <slrnd72b9v.mkm.c4y0@poseidon.antivirusysoluciones.com.co>
From: Pascal Bourguignon <pjb@informatimago.com>
Date: Fri, 29 Apr 2005 00:50:59 +0200
Message-ID: <87oebyjz1o.fsf@thalassa.informatimago.com>
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)
Cancel-Lock: sha1:XkrUmMX06jLTK8TqnR60MWbL0pg=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 28
Organization: [posted via Easynet Spain]
NNTP-Posting-Host: 62.93.174.79
X-Trace: DXC=<43OMjCYZh`:?ZMInfn_MmEY<>`XO4V7m>Uh<g3k39Ld