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

#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); }
// returns number of bytes written on success
// 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();
const char* buf = stdStr.c_str();
size_t count = strlen(buf);
ssize_t nwritten = sftp_write(p->file, buf, count);
int count = str.size();
int nwritten = sftp_write(p->file, buf, count);
return nwritten;
}
......@@ -281,9 +282,9 @@ bool SFTPFile::seek(size_t offset)
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;
}
......
......@@ -350,11 +350,11 @@ class RSM_PUBLIC SFTPFile
SFTPFile(SFTPSession* sftpSession, QString filename, int accessType);
~SFTPFile();
bool isOpen();
ssize_t write(QString str);
int write(QString str);
QString read(size_t nBytes);
bool close();
bool seek(size_t offset);
size_t tell();
uint64_t tell();
}; // 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