Re: Import remote files via scp?
- To: mathgroup at smc.vnet.net
- Subject: [mg91948] Re: Import remote files via scp?
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Mon, 15 Sep 2008 03:38:18 -0400 (EDT)
- Organization: University of Bergen
- References: <firstname.lastname@example.org>
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.)