[Scilab-Dev] SEP 88: New functions to get remote files

Sylvestre Ledru sylvestre.ledru at scilab-enterprises.com
Fri Mar 29 13:16:33 CET 2013


Le 23/03/2013 13:58, Samuel Gougeon a écrit :
> Hello Sylvestre,
>
> Le 24/01/2013 18:14, Sylvestre Ledru a écrit :
> *getURL() and getURLcontent()*:
> At the first glance, it is hard to understand the difference between
> getURL() and
> getURLcontent(). Actually, it is very slight. Since it is only a
> matter of output and
> that 90% of their respective jobs are the same, in my opinion, this
> does not
> deserve 2 distinct functions: It would be nicer to add an option
> specifying the
> output, or even more simply to have a second optionnal output argument:
> [filename [, content]] = getURL(...)
> It is always possible to specify a trash-file as filename.
> or
> output = getURL(...,"returnContent")
> At least, for the moment, a single help page merging the description
> of both
> functions would be nice.
It implemented your proposal.
The profile of getURL is now:
            [filename, [content]] = getURL(URL [, targetDir [, username
[, password]]]]);
and getURLcontent has been removed.
Thanks for your proposal, it is indeed way better.

It should be available in the next nightly builds.

>
> _Present embarassing limitations w.r.t. curl features_:
> The most frustrating one is that these functions allow only queries in
> GET method.
> The POST method is not available,  whereas curl allows it with no
> problem and
> very great utility.
> => So: It would be very useful to add a curl_options string optionnal
> parameter,
> that would be passed to curl as is, allowing to post data with "-d
> param=value ...etc"
> and any other curl usage.
> By the way, specifying a file in which to dump the targetted content
> is possible
> in this way. Proxy parameters can also be specified.
>
It is not that easy to implement (all options won't be available, they
are taking different types of arguments, etc) but
I will work on this later.
> Presently, it is not natural to use atomsSetConfig() to specify a
> proxy to use for
> getURL...().
I agree with you. We could:
* move the proxy configuration as something more global to Scilab
* manage it with preferences() and a dedicated function.
>
>
> *splitURL()*:
> works fine :-) IMO, its help page should be located in the "paths -
> filenames"
> subsection, together with fileparts() and other paths-processing
> functions.
Done

Thanks again for your suggestion,
Sylvestre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20130329/f0b464ea/attachment.htm>


More information about the dev mailing list