GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
using NOCWD for checking ftp directory exists is less standard, and will just return empty list (no error) for non-existed remote directory, e.g. on xbmc's ftp server.
try this command line to known what I said:
curl -v ftp://user:pwd@ftpserveraddr/non_existed_dir/ --ftp-method nocwd
This PR fixed this issue by using singlecwd mode of curl for checking directory exists/stat.
Fix CurlFile::Exists/Stat for check ftp directory with proper cwd met…
Use HasSlashAtEnd() for that. Same for the one below.
it is limited in the ftp scope, so use "/" should be ok, I don't think there is ftp/http url with back-slash, and this is in CurlFile scope, all other code in CurlFile.cpp use "/", so it's ok?
IMO the others in CurlFile should also use AddSlash/HasSlash...
name a valid ftp or http url according RFC with '' as path segment separator, then I will agree with you.
Doesn't matter. It's less code to use addslashatend/removeslashatend and it
is not performance critical.
I do not agree with it. It's clearly here I only want to check whether the last char of the url path is '/', rather than ''
Probably should have looked at the diff.. I agree.
However trailing slash is not guaranteed for directories. May not matter i
added commit to make sure ftp dir url ends with slash.
That may work. But we don't guarantee it for our normal file manipulations.
But for this use case I think it should be fine.
For the rest: looks good.
will merge after 2 days, if no objection.
This is overly complicated. Following will do:
CStdString file = strPath;
Make sure call CurlFile::Exists with url path ends with slash for ftp…
@elupus this one also, going to merge, already updated as you suggested.
Merge pull request #2274 from ulion/fix_curl_exists_stat_for_ftpdir
Fix CurlFile::Exists/Stat for check ftp directory with proper cwd method.