Skip to content

GetListing sometimes lists content of CWD instead of specified directory? #263

Closed

Description

@ExplodingCabbage

I have no idea how to reproduce, but this appears to be the issue being described at https://stackoverflow.com/q/41466095/1709587

Activity

  1. robinrodricks commented on Jan 8, 2018

    @robinrodricks
    Owner

    Good catch, but I'll really need both the working (FileZilla) and the FluentFTP logs to compare them and see what gives.

  2. ExplodingCabbage commented on Jan 8, 2018

    @ExplodingCabbage
    Author

    Yeah, it's hard to guess at what's going on without any information about what server they were using or how it was responding to requests.

  3. A9G-Data-Droid commented on Jun 4, 2020

    @A9G-Data-Droid

    I saw this today on a non-standard FTP server hosted by an old embedded device. What I can tell is that when you ask the server to LIST /FOLDERNAME it just lists the folder name. When I look at the FileZilla logs I can see that what FileZilla is doing is changing directory in to that folder and then issuing a blank LIST. This behavior is required on the set of devices I am using. Let me know if you need me to do additional testing.

    CWD /FOLDERNAME
    LIST
    
  4. A9G-Data-Droid commented on Jun 5, 2020

    @A9G-Data-Droid

    Here is a redacted example of the problem:

    Status:   Connecting to 
    Response: 220 FTP server ready.
    Command:  USER ***
    Response: 331 User name okay, need password.
    Command:  PASS ***
    Response: 230 User logged in, proceed.
    Status:   Text encoding: System.Text.ASCIIEncoding
    Command:  SYST
    Response: 502 SYST command not implemented, or not allowed.
    Warning:  Cannot auto-detect listing parser for system 'Unknown', using Unix parser
    Command:  TYPE A
    Response: 200 TYPE Command okay.
    Command:  PASV
    Response: 227 Entering Passive Mode ().
    Status:   Connecting to 
    Command:  LIST /FOLDERNAME
    Response: 150 File status okay; about to open data connection.
    +---------------------------------------+
    Listing:  drwxrwxrwx   1 owner    group               0 Jan 01  2000 FOLDERNAME
    -----------------------------------------
    Status:   Disposing FtpSocketStream...
    Response: 226 Closing data connection.
    Status:   Disposing FtpSocketStream...
    Status:   Confirmed format Unix
    Command:  QUIT
    Response: 221 Goodbye.
    Status:   Disposing FtpSocketStream...
    Status:   Disposing FtpClient object...
    Status:   Disposing FtpSocketStream...
    
  5. A9G-Data-Droid commented on Jun 5, 2020

    @A9G-Data-Droid

    To get the behavior I want I am using:

    client.SetWorkingDirectory(ftpPath);
    var ftpList = Await client.GetListingAsync(null, FtpListOption.NoPath);
    

    It would be nice to have a Custom Server detection that would behave this way. I would write one for my case but I don't see GetListingAsync as an Extendable handlers here https://github.com/robinrodricks/FluentFTP/wiki/Custom-Servers.

    Is this difficult to do?

    NOTE: Solution is identical to what is proposed as the solution to #101

  6. FanDjango commented on Sep 19, 2022

    @FanDjango
    Collaborator

    See Wiki path problems

  7. A9G-Data-Droid commented on Sep 19, 2022

    @A9G-Data-Droid

    Wait, the solution was to document the workaround? Why not have a custom server definition we can use when we need this behavior? Then I could just turn on the feature for servers that require it.

  8. FanDjango commented on Sep 19, 2022

    @FanDjango
    Collaborator

    Ok, I see what you are saying. Let's put Extendable Server Detection on the bucket list. Is that a good next step?

    But that would not be enough. You and others would also want Extendable ?????-APIs as well. I know there are already a few, but is that a good direction to move in?

    The trend at the moment goes toward having this "workaround" behaviour become the norm for all servers anyway. But that is a big next step right now.

  9. FanDjango commented on Sep 19, 2022

    @FanDjango
    Collaborator

    @A9G-Data-Droid This is now pending being transferred to the list of planned enhancements. Then this issue will once again be closed.

    What you are requesting is already in the overall plan, so this is slightly redundant.

    Referring this to the Wiki is to help those who browse these open or closed issues and need an immediate workaround to achieve their goals without waiting for enhancements.

  10. robinrodricks commented on Sep 20, 2022

    @robinrodricks
    Owner

    @A9G-Data-Droid We are planning on having this behavior done automatically, so we are in line with how filezilla handles things. It was planned for v40 but skipped due to lack of time. I'm aware of this. See - https://github.com/robinrodricks/FluentFTP/wiki/Future-Plans#getlisting-path-handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址