Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Format of Entries in FTP.CFG

Jun
762
16
The help says that the entries in the ftp.cfg file should have the following format:

url [(alias)] username password [directory template]

However, there are no examples or description of the optional "directory template" item, and I have not been able to figure out how to get that part to work. I thought that it would be something like

ftp://myserver.com (work) username password workdir/

or some form of that, perhaps with "/workdir" or "/workdir/" or "/workdir/*". No matter what I have tried, after
Code:
iftp work
a command such as
Code:
dir ftp:
shows the contents of the root directory, not the "workdir" directory.

Can anyone help?
 
There is an explanation and an example under help ftpservers.

That said, unless you have an oddball FTP server, you probably don't need the template. In most cases, the password will be the last item on the line.
 
Thanks, Charles. That's the page from which I quoted the format for the line:

url [(alias)] username password [directory template]

Your comment, however, made me realize finally that the discussion at the end about "directory formats" of non-standard servers was about the "directory template" option.

Now for a follow-on question. Is there are way that I can create a definition in the cfg file that will log into the server and select a default directory other than the root? (That's what I thought, and hoped, the "directory" option was about.)

My current workaround is to create FTP directory aliases, such as

ftpwork:=ftp://username:[email protected]/workdir/

Similarly, I create the following kind of alias to set up IFTP to access a subdirectory:

alias iftpwork=echo. & echo ` `IFTP set to "workdir" folder on myserver.com & iftp "work/workdir"

It would have been nice if an "alias" in ftp.cfg could do that.
 
Now for a follow-on question. Is there are way that I can create a definition in the cfg file that will log into the server and select a default directory other than the root? (That's what I thought, and hoped, the "directory" option was about.)

Not that I'm aware of. Might be a good idea to suggest -- if you can think of a way to implement it that's backward-compatible with the existing syntax.
 
Not that I'm aware of. Might be a good idea to suggest -- if you can think of a way to implement it that's backward-compatible with the existing syntax.
Maybe I'm missing something but couldn't the third '/' (if present) and anything after it in the URL part of the CFG file entry be ignored when connecting, and then whatever follows that third '/' be used in a CD (FTP) command. I suppose "copy ftp://..." works something like that.

For example, this FTP.CFG entry

Code:
ftp://ftp.jpsoft.com/subdir/... fred secret

could mean connect to ftp://ftp.jpsoft.com, then CD to subdir/...
 
Back
Top