How To Stop Filestreams From Dereferencing Symbolic Links #84134
Unanswered
TylerMizuyabu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm currently using the library SharpZipLib to tar archive a bunch of files and folders that may contain symbolic links that I want to preserve. The project is in dotnet 6 and I started running into some issues where reading symbolic links would usually throw an error if they targeted files because of a size mismatch. I create a tar entry that is a duplicate of the file but I want to preserve the symbolic link as if I were to actually run a
tar -cf ...
command. I started looking into what the issue could be and it looks like theSystem.IO.File
class'sOpenRead
method being used by the library is opening up the file target, whose content size wouldn't match the size of the tar file causing an error because the size of bytes expected were larger than the size of bytes it was trying to read. And after some further reading it looks like this is actually the result of a change made to dotnet 6's FileStreams and I have yet to find a way around this.So my question is:
Is there a way around the changes made in dotnet 6 so it doesn't dereference the symlink?
I have noticed that in dotnet 7 support for tar archiving was added and I am considering this option but I would still like to know if there is a solution that can be implemented in dotnet 6.
Beta Was this translation helpful? Give feedback.
All reactions