-
Notifications
You must be signed in to change notification settings - Fork 3
/
_zipadd.prg
69 lines (38 loc) · 1.02 KB
/
_zipadd.prg
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
*!* _zipadd
lparameters ptype, psfilepath, pblobdata, pzfilepath, pfilecomment, pfiletime
Local isfile, narea
if empty(m.pblobdata) and m.ptype == 'BLOB'
error 'BLOB DATA IS EMPTY'
endif
if empty(m.psfilepath) and m.ptype == 'FILE'
error 'BLOB DATA IS EMPTY'
endif
if empty(m.pzfilepath)
error 'ZIP PATH IS EMPTY'
endif
if empty(m.pfiletime)
m.pfiletime = {//::}
endif
if empty(m.pfilecomment)
m.pfilecomment = ''
endif
m.narea = select()
select 'zip_temp'
*!* IF A ZIP FILE WITH THE SAME NAME ALREADY EXISTS, REPLACE IT
locate for zip_temp.zfilepath == m.pzfilepath
if not found('zip_temp')
append blank in 'zip_temp'
endif
if right(m.psfilepath, 1) = '\' or directory(m.psfilepath)
m.isfile = 0
else
m.isfile = 1
endif
replace ;
zip_temp.sfilepath with m.psfilepath, ;
zip_temp.zfilepath with m.pzfilepath, ;
zip_temp.blobdata with m.pblobdata, ;
zip_temp.isfile with m.isfile, ;
zip_temp.filecmnt with m.pfilecomment, ;
zip_temp.filetime with m.pfiletime in 'zip_temp'
_zuselect(m.narea)