Hi,
Since Mac OS X does not include wget in its default install but does
include curl, should pacman be updated to use wget or curl (instead of
just wget)?
I haven't tested it in the context of JAL, but here's a stab at
rewriting pacman's wget function to use curl instead of wget.
In looking at the function, I also wonder if it should be trapping
interface errors from 2!:0 in hostcmd.
wget=: 3 : 0
'f t'=. 2 {. (boxxopen y),a:
n=. f #~ -. +./\. f e. '=/'
p=. jpath '~temp/',n
q=. jpath '~temp/wget.log'
NB. t=. ' ',(0<#t)#'-t ',(":t),' '
t=. ' ',(0<#t)#'--retry ',(":t),' '
ferase p;q
NB. hostcmd 'wget -o ',(dquote q),' -O ',(dquote p),t,f
hostcmd 'curl --stderr ',(dquote q),' -o ',(dquote p),t,f
NB. curl does not create output files if there is an error
NB. but it seems like both wget and curl would cause an
NB. interface error in 2!:0 on unix under e.g. DNS failure
NB. if. 0 = #freads p do.
if. 0 _1 e.~ fsize p do.
msg=. freads q
log 'Connection failed: ',msg
info 'Connection failed:',LF2,msg
r=. 1;msg
ferase p;q
else.
r=. 0;p
ferase q
end.
r
)
NB. end
Cheers,
Zach
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm