MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / Pwd

Method Pwd

src/FTPClientWrapperSSH.cpp:182–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182int FTPClientWrapperSSH::Pwd(char* buf, size_t size) {
183 char * sftppath = sftp_canonicalize_path(m_sftpsession, ".");
184 if (!sftppath)
185 return OnReturn(-1);
186
187 size_t len = strlen(sftppath);
188 if (len > (size-1)) {
189 ssh_string_free_char(sftppath);
190 return OnReturn(-1);
191 }
192
193 strncpy(buf, sftppath, size);
194 if (len > 1 && buf[len-1] == '/')
195 buf[len-1] = 0;
196
197 ssh_string_free_char(sftppath);
198
199 return OnReturn(0);
200}
201
202int FTPClientWrapperSSH::Rename(const char * from, const char * to) {
203 int retcode = sftp_rename(m_sftpsession, from, to);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected