Re: ftp from mathematica code
- To: mathgroup at smc.vnet.net
- Subject: [mg74813] Re: ftp from mathematica code
- From: "Hans Michel" <hmichel at cox.net>
- Date: Fri, 6 Apr 2007 04:21:14 -0400 (EDT)
- References: <eusl95$9h0$1@smc.vnet.net><euvmc4$dfe$1@smc.vnet.net> <ev2bgk$klo$1@smc.vnet.net>
I Kantian: What David Bailey refers to is an easily found Mathematica function called GetURL (Don't recall if it is built in or not). I don't recall at which Mathematica version the Import command could fetch straight to a URI that is none local but in version 5.2 and possibly 5.1 Import["ftp..."] will do. So for example Import["ftp://ftp.microsoft.com/developr/readme.txt"] Will place the content of this readme file to the next output. You can look up all the Import Options and how to assign the stream etc. This is documented in "1.11.7 Exchanging Material with the Web" of the Help Document. Additionally the website that David sent you to refers to how to configure your URI for a particular service type. It could be that the ftp site you require needs a user name and password if so follow the instructs at the site David supplied. Also look up ImportString[], GetURL, and search this user group as this question has been asked. I just don't recall when. For example again using the Microsoft ftp site g = Import[ "ftp://ftp.microsoft.com/deskapps/games/public/Screenshots/Asherons_Call/snap0111.jpg", "JPEG"] Show[g] Should show a jpeg image. GetURL has an older functionality meaning that in some version of Mathematica Import["ftp...."] will not work where as GetURL has been around since J/Link I think. See here http://library.wolfram.com/examples/GetURL/ Even without these function on Unix, Linux, DOS, ... if a command line ftp client was availble you could redirect output of the shell command to Mathematica. Hans <ikantian at yahoo.com> wrote in message news:ev2bgk$klo$1 at smc.vnet.net... > Can you just give me the function, perhaps? & still don't exactly see > how this would work getting a file from within Mathematica code. > Thx. > > > On Apr 4, 1:07 am, David Bailey <dave at Remove_Thisdbailey.co.uk> wrote: >> ikant... at yahoo.com wrote: >> > is it possible to ftp (get) a file from within either/both a >> > mathematica notebook code or/and an m file code running on the command >> > line (should be equivalent, right?). >> > thx for any help. >> >> My SuperWidgetPackage(SWP) (whose main purpose is to simplify the >> creation of GUI's) contains a function GetURL that will do what you >> want. If you need to quote a password, use the syntax described >> here:http://www.lugaru.com/man/URL.Syntax.html. >> >> The SWP can be downloaded for free from my website. >> >> David Baileyhttp://www.dbaileyconsultancy.co.uk > > >