Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Indy + IdFTPListParseVMS (https://www.delphipraxis.net/136745-indy-idftplistparsevms.html)

Ines 7. Jul 2009 10:26


Indy + IdFTPListParseVMS
 
Hallo DP'ler!

Ich muß Dateien mit FTP vom Server herunterladen (TIdFTP).

Es gibt spezielle Dateien zum "Aufbereiten" der Daten vom Server (in meinem Fall VMS).

Hier ein kleiner Ausschnitt aus dem File IdFTPListParseVMS:

Delphi-Quellcode:
type
  TIdVMSFTPListItem = class(TIdOwnerFTPListItem)
  protected
    FGroupName : String;
    FVMSOwnerPermissions: String;
    FVMSWorldPermissions: String;
    FVMSSystemPermissions: String;
    FVMSGroupPermissions: String;
    FNumberBlocks : Integer;
    FBlockSize : Integer;
    FVersion : Integer;
  public
    property GroupName : String read FGroupName write FGroupName;
    property VMSSystemPermissions : String read FVMSSystemPermissions write FVMSSystemPermissions;
    property VMSOwnerPermissions : String read FVMSOwnerPermissions write FVMSOwnerPermissions;
    property VMSGroupPermissions : String read FVMSGroupPermissions write FVMSGroupPermissions;
    property VMSWorldPermissions : String read FVMSWorldPermissions write FVMSWorldPermissions;
    property Version : Integer read FVersion write FVersion;
    property NumberBlocks : Integer read FNumberBlocks write FNumberBlocks;
    property BlockSize : Integer read FBlockSize write FBlockSize;
  end;
Jetzt meine Frage: Wenn ich auf die Parameter BlockSize oder NumberBlocks zugreifen möchte - wie stelle ich das an?
Ich geb's ja zu - ich steh' momentan auf der Leitung.

Danke für Eure Hilfe
Ines

P.S. Ich verwende Delphi2009 und Win XP.

Assertor 7. Jul 2009 12:52

Re: Indy + IdFTPListParseVMS
 
Hi Ines,

Du liest den Verzeichnisinhalt normal aus, z.B.

Delphi-Quellcode:
uses
  ..., IdFTPListParseVMS;

...
begin
  IdFTP1.ChangeDir('/mydir');
  IdFTP1.List; // füllt DirectoryListing
end;
Danach kannst Du auf die VMS Details z.B. so zugreifen:
Delphi-Quellcode:
   for i := 0 to IdFTP1.DirectoryListing.Count-1 do
   begin
     // hier normale Details abfragen
     ...
     if IdFTP1.DirectoryListing[i] is TIdVMSFTPListItem then
     begin
       // Details nur für VMS abfragen:
       s := TIdVMSFTPListItem(IdFTP1.DirectoryListing[i]).GroupName;
       i := TIdVMSFTPListItem(IdFTP1.DirectoryListing[i]).BlockSize;
     end;
   end;
Es wird also nur auf die Klasse des DirectoryListing-Eintrags geprüft und wenn dieser ein VMS-Eintrag ist ein harter Cast durchgeführt, um die Details zu erreichen.

Hoffe, das ist verständlich und hilft.

Gruß,
Assertor

Ines 7. Jul 2009 13:23

Re: Indy + IdFTPListParseVMS
 
Hallo Assertor,

danke für Deine Hilfe - es klappt!
Du hast mir viel Zeit gespart - jetzt kann ich an meinem Projekt weiterarbeiten.

Einen schönen Tag
Ines

Assertor 7. Jul 2009 14:00

Re: Indy + IdFTPListParseVMS
 
Hi Ines,

Zitat:

Zitat von Ines
danke für Deine Hilfe - es klappt!
Du hast mir viel Zeit gespart - jetzt kann ich an meinem Projekt weiterarbeiten.

Einen schönen Tag
Ines

Bitte, gerne! Freut mich helfen zu können. Ebenso einen schönen Tag noch!

Gruß Assertor

:dp:


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:33 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz