diff --git a/src/apps/codycam/FtpClient.cpp b/src/apps/codycam/FtpClient.cpp index 0441eb2fca..bcb9b28f88 100644 --- a/src/apps/codycam/FtpClient.cpp +++ b/src/apps/codycam/FtpClient.cpp @@ -245,6 +245,8 @@ FtpClient::PutFile(const string& local, const string& remote, ftp_mode mode) if (rc) { _GetReply(replyString, code, codeType); rc = codeType <= 2; + // at least BeOS' ftpd forces 640 which RobinHood doesn't like... + Chmod(remote, "644"); } return rc; @@ -357,6 +359,31 @@ FtpClient::MoveFile(const string& oldPath, const string& newPath) } +bool +FtpClient::Chmod(const string& path, const string& mod) +{ + bool rc = false; + int code, codeType; + string cmd = "SITE CHMOD ", replyString; + + cmd += mod; + cmd += " "; + cmd += path; + + if (path.length() == 0) + cmd += '/'; +printf("cmd: '%s'\n", cmd.c_str()); + if (_SendRequest(cmd) == true) { + if (_GetReply(replyString, code, codeType) == true) { +printf("reply: %d, %d\n", code, codeType); + if (codeType == 2) + rc = true; + } + } + return rc; +} + + void FtpClient::SetPassive(bool on) { diff --git a/src/apps/codycam/FtpClient.h b/src/apps/codycam/FtpClient.h index 91faeb730e..ac91f6dd91 100644 --- a/src/apps/codycam/FtpClient.h +++ b/src/apps/codycam/FtpClient.h @@ -45,6 +45,7 @@ class FtpClient { bool ChangeDir(const string& dir); bool PrintWorkingDir(string& dir); bool ListDirContents(string& listing); + bool Chmod(const string& path, const string& mod); void SetPassive(bool on);