MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Import[] remote files via scp?

  • To: mathgroup at
  • Subject: [mg91948] Re: Import[] remote files via scp?
  • From: Szabolcs Horvát <szhorvat at>
  • Date: Mon, 15 Sep 2008 03:38:18 -0400 (EDT)
  • Organization: University of Bergen
  • References: <gag2id$36j$>

Eugene Kirpichov wrote:
> Does Mathematica support opening files via scp or sftp?
> Or is there a separate package around to do that?
> Or is it possible to write one, using only the Mathematica API without
> foreign functions?
> (Otherwise, seems like I'll have to J/Link with the jsch library and
> post my results here)

Import can read from pipes.  Assuming that you use public key 
authentication (and thus do not need to type a password), the following 
*should* work on a Unix system, but I have not tested it:

Import["!ssh remote-machine cat path/to/your/file", "Table"]

(It is important to explicitly specify the data type, e.g. "Table", when 
Import is reading from a pipe.)

  • Prev by Date: Re: How to find the best fit for a list {x,y} of data
  • Next by Date: A interesting case
  • Previous by thread: Import[] remote files via scp?
  • Next by thread: A interesting case