You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
Does this support long paths / filenames like the 7Zip GUI or command line does? When I try to pass a folder(s) to zip that has a long path it errors out with a can't find part of the path error. Passing a directory with normal < 260 char paths works just fine. The normal 7Zip Gui can zip directories with long paths with no issue. Windows OS
Dim sz As New SevenZip.SevenZipCompressor
sz.CompressionLevel = SevenZip.CompressionLevel.Ultra
sz.CompressionMode = SevenZip.CompressionMode.Create
sz.CompressionMethod = SevenZip.CompressionMethod.Default
sz.CompressDirectory("f:\mycomputer", "f:\testy.7z") *****works OK as long as the paths are not long..
manually zipping it with 7zip works OK.
The text was updated successfully, but these errors were encountered:
Does this support long paths / filenames like the 7Zip GUI or command line does? When I try to pass a folder(s) to zip that has a long path it errors out with a can't find part of the path error. Passing a directory with normal < 260 char paths works just fine. The normal 7Zip Gui can zip directories with long paths with no issue. Windows OS
Dim sz As New SevenZip.SevenZipCompressor sz.CompressionLevel = SevenZip.CompressionLevel.Ultra sz.CompressionMode = SevenZip.CompressionMode.Create sz.CompressionMethod = SevenZip.CompressionMethod.Default sz.CompressDirectory("f:\mycomputer", "f:\testy.7z") *****works OK as long as the paths are not long..
manually zipping it with 7zip works OK.
this should work for you.
// if the path of the file including the file name exceeds 256 characters we need to change it's prefix.
if (file.Length > 256)
{
// prefix depends if it's on a share or on a local disk
longFile = (file[0] == '\\') ? file.Replace("\\\\", @"\\?\UNC\") : $@"\\?\{file}";
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Does this support long paths / filenames like the 7Zip GUI or command line does? When I try to pass a folder(s) to zip that has a long path it errors out with a can't find part of the path error. Passing a directory with normal < 260 char paths works just fine. The normal 7Zip Gui can zip directories with long paths with no issue. Windows OS
Dim sz As New SevenZip.SevenZipCompressor
sz.CompressionLevel = SevenZip.CompressionLevel.Ultra
sz.CompressionMode = SevenZip.CompressionMode.Create
sz.CompressionMethod = SevenZip.CompressionMethod.Default
sz.CompressDirectory("f:\mycomputer", "f:\testy.7z") *****works OK as long as the paths are not long..
manually zipping it with 7zip works OK.
The text was updated successfully, but these errors were encountered: