Proper File Resume

Advertisement

tmp
Guest

Proper File Resume

Hi,

I would like to see a better workin file resume when files to be resumed
dont have a .filepart extension. The alternative method to resume is really annoying if you have many files to resume.
Why cant the destination file's size be checked with the source file and if the destination file is smaller ask to resume and have option to always resume.

Example:

if(isFilepart(destFile))
{
...resume as usual, file has a .filepart extension
}
else if(exist(destFile) && (size(destFile) < size(srcFile)))
{
...resume
}

Thank you

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,477
Location:
Prague, Czechia

Re: Proper File Resume

tmp wrote:

The alternative method to resume is really annoying if you have many files to resume.
Why cant the destination file's size be checked with the source file and if the destination file is smaller ask to resume and have option to always resume.
OK, calm down, it can be. Maybe :-)

But anyway, I wonder what is your "use case"? How does it happen that you have several files to be resumed without the ".filepart" extension?
_________________
Martin Prikryl

Reply with quote

tmp
Guest

hehe I am calm :)

Well I use mostly FTP whenever I can to sync files but depending
where I am at the FTP can be blocked and then I use winscp and
if the transfer got aborted using FTP and I am at work using winscp
it gets tedious to resume because ftp client doesnt add no .filepart extension....

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,477
Location:
Prague, Czechia

tmp wrote:

Well I use mostly FTP whenever I can to sync files but depending
where I am at the FTP can be blocked and then I use winscp and
if the transfer got aborted using FTP and I am at work using winscp
it gets tedious to resume because ftp client doesnt add no .filepart extension....
OK, Send me an mail and I'll send you back updated version soon, once it's implemented.
_________________
Martin Prikryl

Reply with quote

tmp
Guest

Thanks alot! Will do that.
I really think this is a wise thing to do as it simplifies things and is more logical.

Thanks

Reply with quote

tmp
Guest

Hey,

took a quick look at the src code:

@SftpFileSystem.cpp Line 3062 in TSFTPFileSystem::SFTPSource

if (DestFileExists)
{
OpenParams.DestFileSize = File->Size;
FileParams.DestSize = OpenParams.DestFileSize;
FileParams.DestTimestamp = File->Modification;
DestRights = *File->Rights;
delete File;
File = NULL;

//add
ResumeOffset = OpenParams.DestFileSize;
ResumeTransfer = SFTPConfirmResume(DestFileName,
ResumeOffset > OperationProgress->LocalSize, OperationProgress);
}

and I guess add to Line 3732 in TSFTPFileSystem::SFTPSink ( what does SFTPSink do anyway?)

FTerminal->LogEvent("Checking existence of the file.");
if (FileExists(DestFullName))
{
FTerminal->OpenLocalFile(DestFullName, GENERIC_WRITE,
NULL, &LocalHandle, NULL, NULL, NULL, &ResumeOffset);

ResumeTransfer = SFTPConfirmResume(DestFileName,
ResumeOffset > OperationProgress->TransferSize, OperationProgress);

Well it shouldnt take much to make it all work proper, and it could replace the alternate method altogether.
Damn I hate C++ but you are doing a great job Martin, been using WinSCP since ~2000

Thanks alot

Reply with quote

Advertisement

You can post new topics in this forum