| Home | Software | Articles | Photos |
|---|
| Physical vs logical path |
|---|
|
Rar, 7-zip and 7-dee translate physical paths (on disk) to logical paths (in archive) differently.
7-zip creates logical path either by copying physical path, or by using only filename, if physical path contains c:, \(root), ..\ or .\.
Rar creates logical path by cropping physical one as little as possible, to get rid of all c:, \(root) and ..\. It silently removes .\.
7-dee creates logical path by cropping physical one as little as possible, to get rid of all c:, \(root), ..\ and .\.
|
| |||||||||||||||||||||||||||||||||||
| Patch 7-zip to become 7-dee |
|---|
//UString CDirItems::GetLogPath(int index) const
//{
// const CDirItem &di = Items[index];
// return GetPrefixesPath(LogParents, di.LogParent, di.Name);
//}
UString CDirItems::GetLogPath(int index) const
{
UString path = GetPhyPath(index);
if (path.Length()>=2 && path[1]==':') path.Delete(0,2);
if (path.Length()==0 || path[0]!='\\') path.Insert(0,'\\');
int pos;
while ((pos=path.Find(L"\\..\\"))>=0) path.Delete(0,pos+3);
while ((pos=path.Find(L"\\.\\"))>=0) path.Delete(0,pos+2);
path.Delete(0,1);
return path;
}
| No warranty |
|---|
I tested it a bit (in complex project where it replaces rar) and it works fine. But stil, I provide it "as is" without any warranty, I did not test everything.
| Downloads |
|---|
| References |
|---|