문제

So I know how to export files @ certain revisions to the filesystem (because all of the overloads for Export have paths in them) but I do not want to have to use the filesystem for ease of access purposes. Is there a way to redirect this to a string or something? Thanks.

도움이 되었습니까?

해결책

I stand corrected, but cannot delete the post.

I took a look at the source code for SharpSVN, and it doesn't look promising. Instead of using .NET file streams for writing to the file system (which might have given us some insight how to use the .NET stream of our choice), the library does native interop when executing commands. The native methods return values indicating success or failure, but do not appear to provide handles to anything we can turn into a MemoryStream or some such in-memory structure.

I think a least-effort solution to the problem is to export revisions to temporary file storage, then read the file(s) into memory with the System.IO classes.

다른 팁

You can use SvnClient.Write() to do this.

Example:

using(var stream = new MemoryStream())
{
    // export urlToFile, at revision 1234:
    client.Write(new SvnUriTarget(new Uri(urlToFile), 1234), stream);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top