Great idea. I even suggest to go further and
as for zip, use a configurable line of the form

   program -option1 %I -option2 %O

where %I - input URL, %O - output file path.

Since it's actual for all platforms and can be
used by other facilities than PacMan, it deserves
a place in system Configuration dialog.

Besides choice of program it has the advantage
of using non-standard location and avoid PATH issues.


--- Zach Reiter <[EMAIL PROTECTED]> wrote:

> 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
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to