Skip to content

Commit

Permalink
Merge pull request #2434 from hyproman/bug-2423-ftp-contents-invisible
Browse files Browse the repository at this point in the history
Bugfix for issue #2423 - FTP contents invisible
  • Loading branch information
PhilippC authored Oct 31, 2023
2 parents 9ea0641 + be2218a commit 2b502df
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Kp2aBusinessLogic/Io/NetFtpFileStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,20 @@ public IEnumerable<FileDescription> ListContents(IOConnectionInfo ioc)
{
using (var client = GetClient(ioc))
{
/*
* For some reason GetListing(path) does not always return the contents of the directory.
* However, calling SetWorkingDirectory(path) followed by GetListing(null, options) to
* list the contents of the working directory does consistently work.
*
* Similar behavior was confirmed using ncftp client. I suspect this is a strange
* bug/nuance in the server's implementation of the LIST command?
*
* [bug #2423]
*/
client.SetWorkingDirectory(IocToLocalPath(ioc));

List<FileDescription> files = new List<FileDescription>();
foreach (FtpListItem item in client.GetListing(IocToLocalPath(ioc),
foreach (FtpListItem item in client.GetListing(null,
FtpListOption.Modify | FtpListOption.Size | FtpListOption.DerefLinks))
{

Expand Down

0 comments on commit 2b502df

Please sign in to comment.