Closed zagadeka closed 2 months ago
In my business case, I don't control the names, so I can't avoid this
Ok. Have you looked at the src code to see if there is an obvious change that would fix this? It seems obvious what is happening. Perhaps you would want to contribute? Especially as it seems to detriment your business?
You do have a number of ways to circumvent this yourself, if you are inventive. Don't put files with the same filename part of the path into the same GetFiles
API operation, do those in a second (or third or....). You could check this yourself.
Still, I consider this to be a bug to be fixed.
I realised that I do not expect a different way of working. This seems to be in line with the way the FTP listen command works.
I realised that I do not expect a different way of working. This seems to be in line with the way the FTP listen command works.
Not sure what you mean by that. I will reopen this. As soon as someone has time, depending on proirities, it is sure to be looked at in more detail and will be investigated.
Thank you for your reply. When writing the previous message I did not notice your reply. I now search the subdirectories and download files from one directory at a time. This way there are no duplicates.
Ok, I have analysed the code and the behaviour.
The description of the DownloadFiles
API is perhaps a little misleading.
/// <summary>
/// Downloads the specified files into a local single directory.
/// High-level API that takes care of various edge cases internally.
/// Supports very large files since it downloads data in chunks.
/// Same speed as <see cref="o:DownloadFile"/>.
/// </summary>
Note the line: Downloads the specified files into a local single directory
.
Repeat: A single local directory
So, if you are downloading, say { "test.log", "log\test.log" } into "C:\destinationdir" he will try to put "test.log" as "test.log" there, and then try to put "log\test.log" there, also as "test.log".
There is no proviso for recursion or for "diving down into subdirectories"
Anyway, this is worth closing as is.
FTP Server OS: Unix
FTP Server Type: Pure-FTPd
Client Computer OS: Windows
FluentFTP Version: 51.0.0
Framework: .NET 8
I get an exception every time I try to download two files with the same name in different directories:
. In my business case, I don't control the names, so I can't avoid this.
Logs :