Downloading Multiple Files Via Import and FTP
- To: mathgroup at smc.vnet.net
- Subject: [mg132196] Downloading Multiple Files Via Import and FTP
- From: Gregory Lypny <gregory.lypny at videotron.ca>
- Date: Mon, 13 Jan 2014 02:25:25 -0500 (EST)
- Delivered-to: email@example.com
- Delivered-to: firstname.lastname@example.org
- Delivered-to: email@example.com
- Delivered-to: firstname.lastname@example.org
Mathematica's Import function works well for downloading single files from a remote computer using ftp, but it gets stuck when downloading anything more than about a 20 files in succession, even when those files are just few bytes.
If I define the path to a folder on my remote mac as
I can easily download a single file, myFile, using
But if I try to download, say, 60 small files whose names are contained in myFileNames by mapping across the names (or by using Table)
Import[ftpPath<> #, "CSV=94] &/@ myFileNames
I get two errors: (1) URLFetch::invhttp : Failure when receiving data from the peer; and (2) FetchURL::conopen.
I thought that maybe Mathematica was sending in the requests too quickly, so I tried slowing things down by inserting a one-second pause between each call to Import but that didn't help. Maybe I have to close a socket between each import but I don't know how to do that.
Anyone know of a fix?
Prev by Date:
Re: Compact formulation of array of constraints
Next by Date:
Re: Questions Regarding Mathematica Kernel Supplied
Previous by thread:
Displaying the solution step by step in Wolfram Mathematica
Next by thread:
Re: Downloading Multiple Files Via Import and FTP