Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all articles
Browse latest Browse all 3862

Rebex FileServer calls Seek whilst CanSeek is false

$
0
0

Hi,

I'm using the Rebex File Server Component and I implemented my own file-system-provider with custom file-streams (which push or pull the data from another service).
This used to work, but since a couple of Rebex versions (not sure exactly since what version) this stopped working.

I do not supported seeking in the file (CanSeek is set to false. I can't support this, since the used services also do not support this).
But, when a file is begin uploaded, the Seek function is being called anyway. For now, all calls to Seek don't really have a purpose (i.e. seeking to the current position). The current implementation I have seems to handle these cases.

Unfortunately, there is no way for me to verify that this handles all calls to Seek correctly and definitely have no way to ensure that will handles all situations correctly when I update Rebex to a new version.

public override bool CanSeek => false;

public override long Seek(long offset, SeekOrigin origin)
{
if (Length == 0)
    return 0;
if (origin == SeekOrigin.End && offset == 0)
    return Length;
throw new NotSupportedException();
}

Can you respect the CanSeek property and not call this function with this is not supported by the stream?


Viewing all articles
Browse latest Browse all 3862

Trending Articles