Using SharpSVN, how can you export a file to memory rather than to the file system?

So, I know how to export files @ some changes to the file system (because all overloads for Export have paths in them), but I do not want to use the file system for easy access. Is there a way to redirect this to a string or something else? Thank.

+3
source share
2 answers

I am correcting, but I can not delete the message.

I took a look at the source code for SharpSVN and it does not look promising. Instead of using .NET file streams to write to the file system (which could give us some idea of ​​how to use the .NET stream of our choice), the library executes its own interop when executing commands. Native methods return values ​​indicating success or failure, but do not display any indications of anything that we can turn into MemoryStreamor some such structure in memory.

I think the solution to the problem with the least effort is to export the changes to temporary file storage, and then read the files in memory using classes System.IO. Strike>

0
source

SvnClient.Write(), .

:

using(var stream = new MemoryStream())
{
    // export urlToFile, at revision 1234:
    client.Write(new SvnUriTarget(new Uri(urlToFile), 1234), stream);
}
+8

Source: https://habr.com/ru/post/1758455/


All Articles