Home Forums .NET libraries Xceed SFTP/FTP for .NET Trouble with FtpFile.Delete() method

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #21090 |
    For example, we have ftp folder with 2 existing files. I try to read them from cycle and delete then. 
     
    FtpConnection connection = new FtpConnection(“10.1.0.213″, 21, @”armentel_main\tech_slt_maf5_exp”, “passwd”);
    connection.TestConnection();
    FtpFolder folder = new FtpFolder(connection, “”); //just for stub
    folder.GetFiles(true, new NameFilter(“*”));
    FtpFile file = new FtpFile(connection, @”\TIAAMRSARM0101312″);
    if (file.Exists)
    {
    DateTime dt = file.LastWriteDateTime;
    file.Delete();//OK success, everything is right!!!
    }
    file = new FtpFile(connection, @”\TIAAMRSARM0101350″);
    if (file.Exists) //freeze for a long time in this line and then continue in right way (but freezing about 2 minutes !!!)
    {
    DateTime dt = file.LastWriteDateTime;
    file.Delete();
    }
     
    What is the reasong of freezeing after Delete() method call?
     
    XceedFTP ver 3.2.6279.0 

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Vitaliy (had 4278 views)

    User (Old forums)
    Member
    Post count: 23064

    Can you set the TraceWriter property so we can get a log of the communication with the server?

    FtpConnection.TraceWriter = new StreamWriter( @”D:\ftp.log”, true );

     

    You are also using an older version. You can try upgrade to a more recent version to see if this resolves the issue.  Note that if you are in .NET 1.1, you need to need to choose choose package version 2.2.6565.0, download and install it.  Once this is done, download and install the latest Service Pack for .NET 1.1 components, and follow the custom steps specified in the Readme file.

    Here is the link to the package :

    http://xceed.com/Xredirect.aspx?url=http://download4.xceedsoft.com/Packages/2.2.6565.0/XceedComponents.exe

    Here is the link to the service pack :

    http://xceed.com/Xredirect.aspx?url=http://download4.xceedsoft.com/Packages/ServicePacksNET11/Xceed.Components.SP.NET1.1.8115.exe

    If you want to upgrade to .NET 2.0 components, simply download the latest package, and install it.  Note that this will remove all .NET 1.1 components.  If you want both on your system, you need to install the .NET 1.1 service pack.

    http://xceed.com/Xredirect.aspx?url=http://download4.xceedsoft.com/Packages/3.2.8577.11540/XceedComponents.exe

     

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 478 views)

    User (Old forums)
    Member
    Post count: 23064

    I get compilation error, wnen try to add logging

     

    An object reference is required for the nonstatic field, method, or property ‘Xceed.Ftp.FtpConnection.TraceWriter.get’ D:\VCitnikov_view\Bell_Sources\Prj.SLOT\Sources\Ftp\FilesLoader\FtpIOProvider.cs

     

     

     

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Vitaliy (had 507 views)

    User (Old forums)
    Member
    Post count: 23064

    In this scenario i  read ftp directory, copy 2 files from ftp-server and then try to delete them…

    I got these log

    > CWD /

    < 250 CWD command successful.

    > CWD /

    < 250 CWD command successful.

    > CWD /

    < 250 CWD command successful.

    > CWD /

    < 250 CWD command successful.

    > TYPE A

    < 200 Type set to A.

    > PASV

    < 227 Entering Passive Mode (10,1,0,213,15,121).

    > LIST

    Data connection established with 10.1.0.213:3961 on 03.12.2008 @ 11:44:44

    < 125 Data connection already open; Transfer starting.

    < 226 Transfer complete.

    < 421 Timeout (120 seconds): closing control connection.

    < 421 Terminating connection.

    Disconnected from 10.1.0.213:21 on 03.12.2008 @ 11:47:12

    Connected to 10.1.0.213:21 on 03.12.2008 @ 11:47:26

    < 220 Microsoft FTP Service

    > USER armentel_main\tech_slt_maf5_exp

    < 331 Password required for armentel_main\tech_slt_maf5_exp.

    > PASS *****

    < 230 User armentel_main\tech_slt_maf5_exp logged in.

    > CWD /

    < 250 CWD command successful.

    > TYPE I

    < 200 Type set to I.

    > PASV

    < 227 Entering Passive Mode (10,1,0,213,15,181).

    > RETR TICME20VMPM040551 

    Data connection established with 10.1.0.213:4021 on 03.12.2008 @ 11:47:26

    < 125 Data connection already open; Transfer starting.

    < 226 Transfer complete.

    > CWD /

    < 250 CWD command successful.

    > DELE TICME20VMPM040551

    < 250 DELE command successful.

    > CWD /

    < 250 CWD command successful.

    > TYPE A

    < 200 Type set to A.

    > PASV

    < 227 Entering Passive Mode (10,1,0,213,15,211).

    > LIST

    Data connection established with 10.1.0.213:4051 on 03.12.2008 @ 11:48:34

    < 125 Data connection already open; Transfer starting.

    < 226 Transfer complete.

    > CWD /

    < 250 CWD command successful.

    > TYPE I

    < 200 Type set to I.

    > PASV

    < 227 Entering Passive Mode (10,1,0,213,16,1).

    > RETR TICME20VMPM040552

    Data connection established with 10.1.0.213:4097 on 03.12.2008 @ 11:51:06

    < 125 Data connection already open; Transfer starting.

    < 226 Transfer complete.

    > CWD /

    < 250 CWD command successful.

    > DELE TICME20VMPM040552

    < 250 DELE command successful.

    > CWD /

    < 250 CWD command successful.

    > TYPE A 

     

    call to 2nd file ‘copy’ method (RETR) takes a lot time (but it is size 500KB)

     This is pared-down piece of code

    AbstractFile[] files = provider.GetFiles(srcFolder, filters);

    for (int i = 0; i < files.Length; i++)

    {

    //Log(Messages.FilesRest, files.Length – i);

    AbstractFile file = files[i];

    file.copy();

     

    FtpFile ftpfile = new FtpFile(connection, fullPath);

    Logger.Log(“DEBUG_COPY FtpFile created”);

    if (ftpfile.Exists) ftpfile .Delete(); 

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Vitaliy (had 645 views)

    User (Old forums)
    Member
    Post count: 23064

    Unfortunately, from what you provided, we can’t identify the source of the issue.

    The only alternative I can thing of at this point is for you to use the FtpClient class to do the same, and see if this changes something to the issue.

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by André (had 4202 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.