🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1321

Re: BCB6 Pro, Indy 9, IdFTPServer LIST problems

#1321
From: Remy Lebeau (TeamB)
Date: Wed, 21 Feb 2007 18:26
40 lines
2820 bytes
"Paul at NCF" <notplmacca@clara.co.uk> wrote in message
news:45dc0f7a@newsgroups.borland.com...

> But I'm setting the server emulate property to DOS, does that
> not mean the server doesn't change to use '\' instead of '/'?

On the server side, yes.  But not on the client side.  Most clients
use Unix style delimiters, because that is what URLs use in general.
You don't really have any control over that.  My advise to you is to
use Unix style paths on the server as well.  And don't use full paths
in the TIdFTPServerThread.CurrentDir property, either, if you can
avoid it.  Yes, then means more work on your part when processing and
translating paths in the various server events.  But it is a more
secure and more compatible approach.

I have posted examples of using TIdFTPServer before.  For example:

http://groups.google.com/group/borland.public.cppbuilder.vcl.components.using/msg/aedff55eaac537d0

http://groups.google.com/group/borland.public.delphi.internet.winsock/browse_thread/thread/3c19ae8b4ac54c02/52dba2730a66773e?lnk=st&q=tidftpserver+group%3A*borland*+author%3Aremy+author%3Alebeau&rnum=13#52dba2730a66773e

> What code needs to go in the dir event handler or (cd handler)?

The OnListDirectory event is responsible for filling in the
TIdFTPListItems collection with the files and folders of the specified
directory.

The OnChangeDirectory event is responsible for validating, and
optionally modifying, the string that will be assigned to the
TIdFTPServerThread.CurrentDir property after the event handler exits.

>     DebugWindow->Lines->Add(str);

That is not thread-safe.  All of the server events are triggered in
the context of a worker thread, not the main thread.  Access to GUI
controls needs to be synchronized, or unexpected things can happen.


Gambit
Technical Details
Message-ID: <45dc8ed6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45d83fd9$1@newsgroups.borland.com> <45db41fd$1@newsgroups.borland.com> <45dc0f7a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,4582a45f81472bd4
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <45d83fd9$1@newsgroups.borland.com> <45db41fd$1@newsgroups.borland.com> <45dc0f7a@newsgroups.borland.com>
Subject: Re: BCB6 Pro, Indy 9, IdFTPServer LIST problems
Date: Wed, 21 Feb 2007 10:26:37 -0800
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <45dc8ed6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1172082390 75.83.34.171 (21 Feb 2007 10:26:30 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail