Our SftpFileStream currently performs separate householding for read and write mode.
This means - for example - that if you:
- open an existing file for read/write
- read two bytes
- write a single byte
The byte that you wrote in step 3 is actually written at position 0 instead of 2.
The following code fragment exposes this:
using(varclient=newSftpClient(...)){client.Connect();using(vars=client.Open(path,FileMode.CreateNew,FileAccess.Write)){s.Write(newbyte[]{5,4,3,2,1},1,3);}using(vars=client.Open(path,FileMode.Open,FileAccess.ReadWrite)){Console.WriteLine("#1: "+s.ReadByte());Console.WriteLine("#2: "+s.ReadByte());Console.WriteLine("#3: "+s.Position);s.WriteByte(7);s.Write(newbyte[]{8,9,10,11,12},1,3);Console.WriteLine("#4: "+s.Position);}}
Our SftpFileStream currently performs separate householding for read and write mode.
This means - for example - that if you:
The byte that you wrote in step 3 is actually written at position 0 instead of 2.
The following code fragment exposes this: