Changeset 655 for soft/giet_vm


Ignore:
Timestamp:
Jul 22, 2015, 2:31:35 PM (9 years ago)
Author:
guerin
Message:

shell: cp: use carriage return to display progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/shell/main.c

    r654 r655  
    9999    if (info.is_dir)
    100100    {
    101         giet_tty_printf("can't copy a directory\n", argv[1]);
     101        giet_tty_printf("can't copy a directory\n");
    102102        goto exit;
    103103    }
     
    114114    if (info.is_dir)
    115115    {
    116         giet_tty_printf("can't copy to a directory\n", argv[2]); // TODO
     116        giet_tty_printf("can't copy to a directory\n"); // TODO
    117117        goto exit;
    118118    }
     
    123123        int len = (size - i < 1024 ? size - i : 1024);
    124124        int wlen;
     125
     126        giet_tty_printf("\rwrite %d/%d (%d%%)", i, size, 100*i/size);
    125127
    126128        len = giet_fat_read(src_fd, &buf, len);
     
    128130        if (wlen != len)
    129131        {
    130             giet_tty_printf("write error\n");
     132            giet_tty_printf("\nwrite error\n");
    131133            goto exit;
    132134        }
    133135        i += len;
    134         giet_tty_printf("wrote %d/%d (%d%%)\n", i, size, 100*i/size);
    135     }
     136    }
     137    giet_tty_printf("\n");
    136138
    137139exit:
Note: See TracChangeset for help on using the changeset viewer.