Re: idFTP, something like ForceDirectories for creating DIRs on a FTP-Server in one shot

Giganews Newsgroups
Subject: Re: idFTP, something like ForceDirectories for creating DIRs on a FTP-Server in one shot
Posted by:  Remy Lebeau \(Indy Team\) (no.spam@no.spam.com)
Date: Wed, 6 Feb 2008

"HHoffmann" <NoMa…@NoReturn.com> wrote in message
news:A38505349847E340NoMa…@NoReturn.com...

> i'm currently searching for a solution for a function like
> "ForceDirectories"
> for use with a FTP-Server (creating nested Dir's in one shot there).

There is nothing in the FTP specification, or in TIdFTP, for that.  You will
have to manually call CreateDir() and ChangeDir() for each folder yourself
recursively, just like ForceDirectories() does internally for hard drive
folders.

> FTP's RFC seems not to offer a command for this on server side.

Correct.

> So is it really the only way to take the qualified path (Dir's) to be
> created
> and then to iterate through the single dirs in the given path top down on
> server side, checking for existance of that level on server side to find
> so the position from where missing dirs have to be created and then to
> create the missing ones step by step?

Yes.

> I think that would take quite a while request->response->next ... ->create
> one missing dir, etc.

Potentially, yes.

> so the questions is if there is something better in don't know yet...

No.  I'm sure there are third-party implementations available, but the
underlying operations are the same, as they are limited to what the RFC
allows.

Gambit

Replies

In response to

idFTP, something like ForceDirectories for creating DIRs on a FTP-Server in one shot posted by HHoffmann on Wed, 06 Feb 2008