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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
#
# NOTE: This procedure was stolen from the "auxiliary.eagle" script.
# This procedure accepts an any number of arguments. The arguments
# are appended into one big string, verbatim. The resulting string
# is returned. Normally, this procedure is used to avoid undesired
# string interpolation operations.
#
proc appendArgs { args } {
eval append result $args
}
}
#
# NOTE: *HACK* Skip defining this procedure if it is already defined in the
# global namespace.
#
if {[llength [info commands ::makeBinaryChannel]] == 0} then {
#
# NOTE: This procedure was stolen from the "file1.eagle" script. This
# procedure reconfigures the specified channel to full binary mode.
#
proc makeBinaryChannel { channel } {
fconfigure $channel -encoding binary -translation binary; # BINARY DATA
}
}
#
# NOTE: *HACK* Skip defining this procedure if it is already defined in the
# global namespace.
#
if {[llength [info commands ::writeFile]] == 0} then {
#
# NOTE: This procedure was stolen from the "file1.eagle" script. This
# procedure writes all data to the specified binary file and returns
# an empty string. Previous data contained in the file, if any, is
# lost.
#
proc writeFile { fileName data } {
set channel [open $fileName {WRONLY CREAT TRUNC}]
makeBinaryChannel $channel
puts -nonewline $channel $data
close $channel
return ""
}
|
>
>
>
|
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#
# NOTE: This procedure was stolen from the "auxiliary.eagle" script.
# This procedure accepts an any number of arguments. The arguments
# are appended into one big string, verbatim. The resulting string
# is returned. Normally, this procedure is used to avoid undesired
# string interpolation operations.
#
# <ignore>
proc appendArgs { args } {
eval append result $args
}
}
#
# NOTE: *HACK* Skip defining this procedure if it is already defined in the
# global namespace.
#
if {[llength [info commands ::makeBinaryChannel]] == 0} then {
#
# NOTE: This procedure was stolen from the "file1.eagle" script. This
# procedure reconfigures the specified channel to full binary mode.
#
# <ignore>
proc makeBinaryChannel { channel } {
fconfigure $channel -encoding binary -translation binary; # BINARY DATA
}
}
#
# NOTE: *HACK* Skip defining this procedure if it is already defined in the
# global namespace.
#
if {[llength [info commands ::writeFile]] == 0} then {
#
# NOTE: This procedure was stolen from the "file1.eagle" script. This
# procedure writes all data to the specified binary file and returns
# an empty string. Previous data contained in the file, if any, is
# lost.
#
# <ignore>
proc writeFile { fileName data } {
set channel [open $fileName {WRONLY CREAT TRUNC}]
makeBinaryChannel $channel
puts -nonewline $channel $data
close $channel
return ""
}
|
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
#
# NOTE: This procedure was stolen from the "getEagle.tcl" script. It is
# designed to process a single HTTP request, including any HTTP
# 3XX redirects (up to the specified limit), and return the raw
# HTTP response data. It may raise any number of script errors.
#
proc getFileViaHttp { uri redirectLimit channel quiet args } {
#
# NOTE: This global variable is used to check the running version of
# Tcl.
#
global tcl_version
|
>
|
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
#
# NOTE: This procedure was stolen from the "getEagle.tcl" script. It is
# designed to process a single HTTP request, including any HTTP
# 3XX redirects (up to the specified limit), and return the raw
# HTTP response data. It may raise any number of script errors.
#
# <public>
proc getFileViaHttp { uri redirectLimit channel quiet args } {
#
# NOTE: This global variable is used to check the running version of
# Tcl.
#
global tcl_version
|