realbasic-nug
[Top] [All Lists]

Re: FTP Suite Help

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: FTP Suite Help
From: Joseph Nastasi <joe at pyramiddesign dot us>
Date: Mon, 28 Feb 2005 13:11:09 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <87b46919604c746bcaac39cbe98ce9aa at nc dot rr dot com>

On Feb 26, 2005, at 10:02 PM, Christian Miller wrote:
The result of this was that all files were uploaded in ASCII format to the last directory specified. Instead, I changed my code to make two passes which works but seems inefficient...
ie:
SetLoginInfo
SetServerDirectoryPathName
Change transfer type to "I"
Upload file x
Upload file y
Upload file z
SetStatusReporting
PassiveMode = True
StartPutFile

<new instance>
SetServerDirectoryPathName
Change transfer type to "A"
Upload file a
Upload file b
Upload file c
SetStatusReporting
PassiveMode = True
StartPutFile


Can somebody shed some light on how I can do all of this in one pass/login?

The Smart Sequences (anything "Startxxx") is really for simple transfers.
I'd suggest using Smart Commands instead.
Where the above is inefficient is having to login and cd to the same directory all the time. Using commands eliminate that bottleneck.

So the sequence would be (all on the same instance:

SetLoginInfo
SetServerDirectoryPathName
Change transfer type to "I"
SetStatusReporting
PassiveMode = True

LOGIN
CHANGE DIRECTORY
Add file x
PUT FILE
Add file y
PUT FILE
Add file z
PUT FILE

Change transfer type to "A"
Add file x
PUT FILE
Add file y
PUT FILE
Add file z
PUT FILE

LOGOFF

This assumes everything goes in the same directory. A little more work, but better for non-trivial transfers.

Also, would someone like to share a routine that will auto-create any directories on the FTP server that do not exist?
....
and the class would create any remote directories it needed to in order to put the local file in the correct remote path.

PUTFILE (and STARTPUTFILE) require that the directory exists. The Smart Command "MakeDir" will create an empty directory for you.
HTH
--
Joseph Nastasi
Pyramid Design - a software development firm
http://www.pyramiddesign.us
Voice 609 601-0814      Fax 609 601-0815
Products:
A-OK! Spacecraft Simulation System - http://aok.pyramiddesign.us
A-OK! The Wings of Mercury
FTP Suite for REALbasic - http://ftpsuite.pyramiddesign.us
Proud Sponsors of REALbasic Olympics 2005




_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>