Commit ff02ca6a authored by Lefebvre, Jordan's avatar Lefebvre, Jordan
Browse files

#2. Windows compliance #2

parent 72c724a8
Pipeline #100484 failed with stages
in 4 minutes and 55 seconds
...@@ -234,12 +234,13 @@ bool SFTPFile::isOpen() { return (p->file != nullptr); } ...@@ -234,12 +234,13 @@ bool SFTPFile::isOpen() { return (p->file != nullptr); }
// returns number of bytes written on success // returns number of bytes written on success
// on error, returns < 0 and ssh and sftp session errors are set // on error, returns < 0 and ssh and sftp session errors are set
ssize_t SFTPFile::write(QString str)
int SFTPFile::write(QString str)
{ {
std::string stdStr = str.toStdString(); std::string stdStr = str.toStdString();
const char* buf = stdStr.c_str(); const char* buf = stdStr.c_str();
size_t count = strlen(buf); int count = str.size();
ssize_t nwritten = sftp_write(p->file, buf, count); int nwritten = sftp_write(p->file, buf, count);
return nwritten; return nwritten;
} }
...@@ -281,9 +282,9 @@ bool SFTPFile::seek(size_t offset) ...@@ -281,9 +282,9 @@ bool SFTPFile::seek(size_t offset)
return true; return true;
} }
size_t SFTPFile::tell() uint64_t SFTPFile::tell()
{ {
size_t result = static_cast<size_t>(sftp_tell64(p->file)); uint64_t result = sftp_tell64(p->file);
return result; return result;
} }
......
...@@ -350,11 +350,11 @@ class RSM_PUBLIC SFTPFile ...@@ -350,11 +350,11 @@ class RSM_PUBLIC SFTPFile
SFTPFile(SFTPSession* sftpSession, QString filename, int accessType); SFTPFile(SFTPSession* sftpSession, QString filename, int accessType);
~SFTPFile(); ~SFTPFile();
bool isOpen(); bool isOpen();
ssize_t write(QString str); int write(QString str);
QString read(size_t nBytes); QString read(size_t nBytes);
bool close(); bool close();
bool seek(size_t offset); bool seek(size_t offset);
size_t tell(); uint64_t tell();
}; // class SFTPFile }; // class SFTPFile
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment