Re: Using tsNet for sftp directory file listing

2016-11-01 Thread Skip Kimpel
Thanks Richard,

This whole tsNet thing has got me all turned around.  Of course the example
you gave works... I am just trying to figure out how this is all aligning
with the future of secured sockets.

SKIP

On Tue, Nov 1, 2016 at 2:31 PM, Richard Gaskin 
wrote:

> Skip Kimpel wrote:
>
> > On 29/10/2016 7:52 AM, Richard Gaskin wrote:
> >>
> >> It's been a while since I've used FTP, but IIRC in previous versions
> >> you could just use "get" on a directory and it'll return the file
> >> list (note that the trailing "/" is important to let libURL know
> >> it's dealing with a directory):
> >>
> >>   get url "ftp://name:pass@server/folder/";
> >>
> >
> > I am still struggling putting this code together correctly.  Does
> > anybody have any working examples of downloading a single file, via
> > sftp protocol?
>
> The example I gave earlier was for your request to obtain a list of files.
>
> To download a single file it should be as easy as just using the full path
> to the file on the server, and changing "ftp" to "sftp":
>
>   get url ("sftp://name:password@server/folder/file.dat";)
>
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  
>  ambassa...@fourthworld.comhttp://www.FourthWorld.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using tsNet for sftp directory file listing

2016-11-01 Thread Richard Gaskin

Skip Kimpel wrote:

> On 29/10/2016 7:52 AM, Richard Gaskin wrote:
>>
>> It's been a while since I've used FTP, but IIRC in previous versions
>> you could just use "get" on a directory and it'll return the file
>> list (note that the trailing "/" is important to let libURL know
>> it's dealing with a directory):
>>
>>   get url "ftp://name:pass@server/folder/";
>>
>
> I am still struggling putting this code together correctly.  Does
> anybody have any working examples of downloading a single file, via
> sftp protocol?

The example I gave earlier was for your request to obtain a list of files.

To download a single file it should be as easy as just using the full 
path to the file on the server, and changing "ftp" to "sftp":


  get url ("sftp://name:password@server/folder/file.dat";)


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using tsNet for sftp directory file listing

2016-11-01 Thread Skip Kimpel
I am still struggling putting this code together correctly.  Does anybody
have any working examples of downloading a single file, via sftp protocol?
I think I can work backwards from there.

SKIP

On Fri, Oct 28, 2016 at 10:52 PM, Charles Warwick <
char...@techstrategies.com.au> wrote:

> On 29/10/2016 7:52 AM, Richard Gaskin wrote:
>
>> Skip Kimpel wrote:
>>
>> > Can anybody guide me in getting a file listing from a remote
>> > directory via SFTP connection?  I currently have tsNet functioning
>> > to make the connection and uploading / downloading an individual
>> > file.  However, I need to retrieve a list of files sitting in a
>> > directory.
>>
>> It's been a while since I've used FTP, but IIRC in previous versions you
>> could just use "get" on a directory and it'll return the file list (note
>> that the trailing "/" is important to let libURL know it's dealing with a
>> directory):
>>
>>   get url "ftp://name:pass@server/folder/";
>>
>> Has that changed?
>>
>> Using "get url /path/to/dir/" or "put url /path/to/dir/ into x" works
> with tsNet for both ftp and sftp protocols.
>
> You can also do the same thing using the synchronous or asynchronous
> tsNetGet* functions by specifying the directory with a trailing slash as
> the URL.
>
> As Richard said, the format varies for directory listings if you get a
> "full" listing.  If you are just after the list of filenames, you can use
> "tsNetSetDirNLST true" if using tsNet commands directly, or
> "libUrlSetFtpListCommand 'NLST'" when using libUrl.
>
> Cheers,
>
> Charles
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using tsNet for sftp directory file listing

2016-10-28 Thread Charles Warwick

On 29/10/2016 7:52 AM, Richard Gaskin wrote:

Skip Kimpel wrote:

> Can anybody guide me in getting a file listing from a remote
> directory via SFTP connection?  I currently have tsNet functioning
> to make the connection and uploading / downloading an individual
> file.  However, I need to retrieve a list of files sitting in a
> directory.

It's been a while since I've used FTP, but IIRC in previous versions 
you could just use "get" on a directory and it'll return the file list 
(note that the trailing "/" is important to let libURL know it's 
dealing with a directory):


  get url "ftp://name:pass@server/folder/";

Has that changed?

Using "get url /path/to/dir/" or "put url /path/to/dir/ into x" works 
with tsNet for both ftp and sftp protocols.


You can also do the same thing using the synchronous or asynchronous 
tsNetGet* functions by specifying the directory with a trailing slash as 
the URL.


As Richard said, the format varies for directory listings if you get a 
"full" listing.  If you are just after the list of filenames, you can 
use "tsNetSetDirNLST true" if using tsNet commands directly, or 
"libUrlSetFtpListCommand 'NLST'" when using libUrl.


Cheers,

Charles


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using tsNet for sftp directory file listing

2016-10-28 Thread Richard Gaskin
PS: Among the many the reasons I've switched to HTTP-based APIs for most 
things with servers is that FTP is notoriously inconsistently 
implemented in terms of the info you'll get back from a directory listing.


Sometimes it'll include the date, sometimes only the time.  The cutoff 
determining that varies.  Sometimes the date may include the year, 
sometimes not.  The cutoff for that also varies.  There are others - the 
RFP is an overflowing clown car of "sometimes" rules, all fully 
permissible in the name of flexibility.


It's not all that bad if we remember why FTP was invented, for ad hoc 
access to file repositories, rather than for providing services APIs.


For the latter, HTTP has proven itself time and again.  If it's feasible 
to use LiveCode Server or some other CGI, getting lists of directory 
contents is easy and can be made consistent, with exactly the format 
your client needs.  Probably much faster too.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using tsNet for sftp directory file listing

2016-10-28 Thread Richard Gaskin

Skip Kimpel wrote:

> Can anybody guide me in getting a file listing from a remote
> directory via SFTP connection?  I currently have tsNet functioning
> to make the connection and uploading / downloading an individual
> file.  However, I need to retrieve a list of files sitting in a
> directory.

It's been a while since I've used FTP, but IIRC in previous versions you 
could just use "get" on a directory and it'll return the file list (note 
that the trailing "/" is important to let libURL know it's dealing with 
a directory):


  get url "ftp://name:pass@server/folder/";

Has that changed?

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Using tsNet for sftp directory file listing

2016-10-28 Thread Skip Kimpel
Can anybody guide me in getting a file listing from a remote directory via
SFTP connection?  I currently have tsNet functioning to make the connection
and uploading / downloading an individual file.  However, I need to
retrieve a list of files sitting in a directory.

As always, your input is greatly appreciated!

SKIP
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode