{"action":"opened","issue":{"url":"https://api.github.com/repos/ashkulz/NppFTP/issues/14","labels_url":"https://api.github.com/repos/ashkulz/NppFTP/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/ashkulz/NppFTP/issues/14/comments","events_url":"https://api.github.com/repos/ashkulz/NppFTP/issues/14/events","html_url":"https://github.com/ashkulz/NppFTP/issues/14","id":57348568,"number":14,"title":"Hello Please help.","user":{"login":"mean-cj","id":1191385,"avatar_url":"https://avatars.githubusercontent.com/u/1191385?v=3","gravatar_id":"","url":"https://api.github.com/users/mean-cj","html_url":"https://github.com/mean-cj","followers_url":"https://api.github.com/users/mean-cj/followers","following_url":"https://api.github.com/users/mean-cj/following{/other_user}","gists_url":"https://api.github.com/users/mean-cj/gists{/gist_id}","starred_url":"https://api.github.com/users/mean-cj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mean-cj/subscriptions","organizations_url":"https://api.github.com/users/mean-cj/orgs","repos_url":"https://api.github.com/users/mean-cj/repos","events_url":"https://api.github.com/users/mean-cj/events{/privacy}","received_events_url":"https://api.github.com/users/mean-cj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-11T17:30:08Z","updated_at":"2015-02-11T17:30:08Z","closed_at":null,"body":"Hello Please help, how to cast variable type\r\n\r\n\"const char * mode\" to mode_t mode\r\n\r\nNow normal ftp can be change permission but sftp can't because the permission number is incorrect.\r\n\r\n# FTPClientWrapperSSH.cpp\r\n```c\r\nint FTPClientWrapperSSH::ChmodFile(const char * path, const char * mode) {\r\n\r\n\t//int cpmode = atoi(mode) ;\r\n\t//mode_t perm = strtoul(mode, 0, 9);\r\n\t//OutMsg(\"FTPClientWrapperSSH::ChmodFile %s == %s =\", strtoul(mode, 0, 9), mode );\r\n\r\n\tint retcode = sftp_chmod(m_sftpsession, path, mode);\r\n\r\n\treturn OnReturn((retcode == 0)?0:-1);\r\n}\r\n```\r\n# sftp.h\r\n```c\r\nLIBSSH_API int sftp_chmod(sftp_session sftp, const char *file, mode_t mode);\r\n```\r\n\r\n\r\n## Test \r\nsftp_chmod(m_sftpsession, path, 0755); work\r\nsftp_chmod(m_sftpsession, path,  atoi(mode)); doesn't work\r\nsftp_chmod(m_sftpsession, path,  strtoul(mode, 0, 9));  doesn't work\r\n\r\n\r\n\r\nThanks"}}