-
-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetListing() generates broken FullName when used on a specific file, breaking GetFilePermissions and GetChmod #325
Comments
Good work finding this! I'll see what I can do.. |
I think the first issue is how do you distinguish the folder paths from file paths? |
My feeling is that |
Or, if you want to just try and detect which is which inside the existing function, you could go by URI guidelines, which require paths to terminate in a "/" and anything else is a file. (https://stackoverflow.com/questions/52610417/uri-for-a-directory-path-only) In that case:
I don't know if this would change the current behavior of the function for your users however. |
Sorry for taking this long. We have Can you try and see if its fixed for you? |
If someone has this issue, feel free to comment and I'll reopen it. Until then I'll assume the fix worked. |
FTP OS: Unix / Windows
FTP Server: Vsftpd
Computer OS: Windows
GetListing is sometimes used to get a single file, such as
GetListing("/1234.txt")
, in which case it returns an array of length 1 with the specified file. This method is used by theGetFilePermissions()
andGetChmod()
functions in the FluentFtp library. Unfortunately, it seems that when used in this way, GetListing generates a brokenFullName
for the item.A listing for "/1234.txt" will generate an FtpListItem with the
FullName
of "/1234.txt/1234.txt". This breaks bothGetFilePermissions()
andGetChmod()
functions, and I believe is also the root cause of issue #101 .I am not certain what the fix would be, but I believe it should be easy to reproduce with some code similar to this.
The FullName will be broken for the second listing.
Logs :
The text was updated successfully, but these errors were encountered: