I have got the MemoryStream idea working although I had to declare the stream as a TMemoryStream otherwise DirStream.Clear will not compile.
I thought strings were dynamic. The string was always cleared before each FTP command. I shall investigate your MLST idea. At least I don't have to keep modifying the FTP Client component each time there is a new release. So that's a bonus already. And maybe the way I was implementing the DownloadToString was not as good as it could have been. Many thanks for you help in this matter. Graham -----Original Message----- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Angus Robertson - Magenta Systems Ltd Sent: 05 March 2010 11:11 To: twsocket@elists.org Subject: Re: [twsocket] FPiette V2.108 vs Overbyte V7.07 - FTP Client > I also mentioned previously that I have modified the FTP Client to > download to a String rather than a file or a Stream. Unless you create a string that is hundreds of thousands of bytes long, or continually extend it each time it's written, you risk overflowing a string since they are not inherently dynamic. > If I ditch the "Download to String" idea and download to a stream, can > I do this without having any disk activity. Is the stream created in > memory or on the disk. A Delphi TStream is an abstract data type, the underlaying format depends upon which specific descendent is created, it may be a memory stream, file stream or various others like buffered streams which are a mix of the two. To save directory listings to a stream, you have something like: var DirStream: TStream ; DirStream := TMemoryStream.Create ; FtpClient.LocalFileName := '' ; FtpClient.LocalStream := DirStream ; FtpClient.Dir ; // process stream DirStream.Free ; FtpClient.LocalStream := nil; Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be