1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| PRIVATE CONST LONGUEUR AS BYTE = 50
PUBLIC SUB Main()
DIM fl1, fl2 AS File DIM b, c AS BYTE DIM k AS INTEGER DIM orig, kp, s AS STRING DIM tmp AS DATE orig = "/Chemin/du/fichier/à/copier"
' Chemin vers lequel le fichier doit être copié: kp = "/tmp/copie." & File.Ext(orig) fl1 = OPEN kp FOR CREATE fl2 = OPEN orig FOR READ
k = (Lof(fl2) \ 100) c = 100 \ LONGUEUR tmp = Now REPEAT INC b IF b < 101 THEN WRITE "\r\e[42m" & Space(b \ c) & "\e[0m" & Space(LONGUEUR + 1 - (b \ c)) & CStr(b) & "%" FLUSH ENDIF READ #fl2, s, -k WRITE #fl1, s, -k UNTIL Eof(fl2) PRINT "\n\n\e[31m"; CStr(Time(0, 0, 0, DateDiff(tmp, Now, gb.Millisecond))) fl2.Close fl1.Close IF Stat(kp).Size == Stat(orig).Size THEN PRINT "\n\e[0mFichier copié avec succès."
END
|