Zip files expand with backslashes on Linux, no subdirectories
So, weirdly, I can unzip a file a friend made on windows. What it gives out is strange, and incorrect in a way I've not seen before.
<base directory stuff>
assetsChanges.txt
assetsDefaultConfig,txt
And so on. It's clearly meant to be a subdirectory, but they come out as files with a backslash in them.
They made it on Windows (using the Compress-Archive powerscript command), I attempted to extract it on Linux, using both the ark
program from KDE, and archive-manager from GNOME.
What's going on here?
linux windows zip
add a comment |
So, weirdly, I can unzip a file a friend made on windows. What it gives out is strange, and incorrect in a way I've not seen before.
<base directory stuff>
assetsChanges.txt
assetsDefaultConfig,txt
And so on. It's clearly meant to be a subdirectory, but they come out as files with a backslash in them.
They made it on Windows (using the Compress-Archive powerscript command), I attempted to extract it on Linux, using both the ark
program from KDE, and archive-manager from GNOME.
What's going on here?
linux windows zip
Yeah, but I want to know why this happens, rather than the fact that it happens on two more or less disparate tools
– jaked122
Dec 12 '18 at 5:17
add a comment |
So, weirdly, I can unzip a file a friend made on windows. What it gives out is strange, and incorrect in a way I've not seen before.
<base directory stuff>
assetsChanges.txt
assetsDefaultConfig,txt
And so on. It's clearly meant to be a subdirectory, but they come out as files with a backslash in them.
They made it on Windows (using the Compress-Archive powerscript command), I attempted to extract it on Linux, using both the ark
program from KDE, and archive-manager from GNOME.
What's going on here?
linux windows zip
So, weirdly, I can unzip a file a friend made on windows. What it gives out is strange, and incorrect in a way I've not seen before.
<base directory stuff>
assetsChanges.txt
assetsDefaultConfig,txt
And so on. It's clearly meant to be a subdirectory, but they come out as files with a backslash in them.
They made it on Windows (using the Compress-Archive powerscript command), I attempted to extract it on Linux, using both the ark
program from KDE, and archive-manager from GNOME.
What's going on here?
linux windows zip
linux windows zip
edited Dec 12 '18 at 6:32
Kamil Maciorowski
24.8k155277
24.8k155277
asked Dec 12 '18 at 4:42
jaked122jaked122
1033
1033
Yeah, but I want to know why this happens, rather than the fact that it happens on two more or less disparate tools
– jaked122
Dec 12 '18 at 5:17
add a comment |
Yeah, but I want to know why this happens, rather than the fact that it happens on two more or less disparate tools
– jaked122
Dec 12 '18 at 5:17
Yeah, but I want to know why this happens, rather than the fact that it happens on two more or less disparate tools
– jaked122
Dec 12 '18 at 5:17
Yeah, but I want to know why this happens, rather than the fact that it happens on two more or less disparate tools
– jaked122
Dec 12 '18 at 5:17
add a comment |
1 Answer
1
active
oldest
votes
It happens because some Windows tools apparently use backslashes () as separators where they should use forward slashes (
/
). Backslash in Unix can be a part of file or directory name.
.ZIP File Format Specification (version: 6.3.5 when I'm writing this, revised November 20, 2018) states:
4.4.17.1 The name of the file, with optional relative path.
The path stored MUST NOT contain a drive or
device letter, or a leading slash. All slashes
MUST be forward slashes/
as opposed to
backwards slashesfor compatibility with Amiga
and UNIX file systems etc. If input came from standard
input, there is no file name field.
This file is mentioned by Microsoft in a document Mitigation: ZipArchiveEntry.FullName
Path Separator:
Starting with apps that target the .NET Framework 4.6.1, the path separator used in the
ZipArchiveEntry.FullName
property has changed from the backslash () used in previous versions of the .NET Framework to a forward slash (
/
). [...]
Impact
The change brings the .NET implementation into conformity with section 4.4.17.1 of the .ZIP File Format Specification and allows .ZIP archives to be decompressed on non-Windows systems.
Decompressing a zip file created by an app that targets a previous version of the .NET Framework on non-Windows operating systems such as the Macintosh fails to preserve the directory structure. For example, on the Macintosh, it creates a set of files whose filename concatenates the directory path, along with any backslash (
) characters, and the filename. As a result, the directory structure of decompressed files is not preserved.
Note the problem may exist if the archiver used some old version of .NET Framework or if it didn't use it at all but implemented its own (independent) approach to zip files.
One may experience the same problem with rar: Unrar creating files with backslashes in names instead of proper directory hierarchy.
You may find this question on Unix & Linux SE helpful: Convert a Windows-created ZIP to Linux (internal paths issue). My (somewhat experimental) approach is in this answer.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1382839%2fzip-files-expand-with-backslashes-on-linux-no-subdirectories%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It happens because some Windows tools apparently use backslashes () as separators where they should use forward slashes (
/
). Backslash in Unix can be a part of file or directory name.
.ZIP File Format Specification (version: 6.3.5 when I'm writing this, revised November 20, 2018) states:
4.4.17.1 The name of the file, with optional relative path.
The path stored MUST NOT contain a drive or
device letter, or a leading slash. All slashes
MUST be forward slashes/
as opposed to
backwards slashesfor compatibility with Amiga
and UNIX file systems etc. If input came from standard
input, there is no file name field.
This file is mentioned by Microsoft in a document Mitigation: ZipArchiveEntry.FullName
Path Separator:
Starting with apps that target the .NET Framework 4.6.1, the path separator used in the
ZipArchiveEntry.FullName
property has changed from the backslash () used in previous versions of the .NET Framework to a forward slash (
/
). [...]
Impact
The change brings the .NET implementation into conformity with section 4.4.17.1 of the .ZIP File Format Specification and allows .ZIP archives to be decompressed on non-Windows systems.
Decompressing a zip file created by an app that targets a previous version of the .NET Framework on non-Windows operating systems such as the Macintosh fails to preserve the directory structure. For example, on the Macintosh, it creates a set of files whose filename concatenates the directory path, along with any backslash (
) characters, and the filename. As a result, the directory structure of decompressed files is not preserved.
Note the problem may exist if the archiver used some old version of .NET Framework or if it didn't use it at all but implemented its own (independent) approach to zip files.
One may experience the same problem with rar: Unrar creating files with backslashes in names instead of proper directory hierarchy.
You may find this question on Unix & Linux SE helpful: Convert a Windows-created ZIP to Linux (internal paths issue). My (somewhat experimental) approach is in this answer.
add a comment |
It happens because some Windows tools apparently use backslashes () as separators where they should use forward slashes (
/
). Backslash in Unix can be a part of file or directory name.
.ZIP File Format Specification (version: 6.3.5 when I'm writing this, revised November 20, 2018) states:
4.4.17.1 The name of the file, with optional relative path.
The path stored MUST NOT contain a drive or
device letter, or a leading slash. All slashes
MUST be forward slashes/
as opposed to
backwards slashesfor compatibility with Amiga
and UNIX file systems etc. If input came from standard
input, there is no file name field.
This file is mentioned by Microsoft in a document Mitigation: ZipArchiveEntry.FullName
Path Separator:
Starting with apps that target the .NET Framework 4.6.1, the path separator used in the
ZipArchiveEntry.FullName
property has changed from the backslash () used in previous versions of the .NET Framework to a forward slash (
/
). [...]
Impact
The change brings the .NET implementation into conformity with section 4.4.17.1 of the .ZIP File Format Specification and allows .ZIP archives to be decompressed on non-Windows systems.
Decompressing a zip file created by an app that targets a previous version of the .NET Framework on non-Windows operating systems such as the Macintosh fails to preserve the directory structure. For example, on the Macintosh, it creates a set of files whose filename concatenates the directory path, along with any backslash (
) characters, and the filename. As a result, the directory structure of decompressed files is not preserved.
Note the problem may exist if the archiver used some old version of .NET Framework or if it didn't use it at all but implemented its own (independent) approach to zip files.
One may experience the same problem with rar: Unrar creating files with backslashes in names instead of proper directory hierarchy.
You may find this question on Unix & Linux SE helpful: Convert a Windows-created ZIP to Linux (internal paths issue). My (somewhat experimental) approach is in this answer.
add a comment |
It happens because some Windows tools apparently use backslashes () as separators where they should use forward slashes (
/
). Backslash in Unix can be a part of file or directory name.
.ZIP File Format Specification (version: 6.3.5 when I'm writing this, revised November 20, 2018) states:
4.4.17.1 The name of the file, with optional relative path.
The path stored MUST NOT contain a drive or
device letter, or a leading slash. All slashes
MUST be forward slashes/
as opposed to
backwards slashesfor compatibility with Amiga
and UNIX file systems etc. If input came from standard
input, there is no file name field.
This file is mentioned by Microsoft in a document Mitigation: ZipArchiveEntry.FullName
Path Separator:
Starting with apps that target the .NET Framework 4.6.1, the path separator used in the
ZipArchiveEntry.FullName
property has changed from the backslash () used in previous versions of the .NET Framework to a forward slash (
/
). [...]
Impact
The change brings the .NET implementation into conformity with section 4.4.17.1 of the .ZIP File Format Specification and allows .ZIP archives to be decompressed on non-Windows systems.
Decompressing a zip file created by an app that targets a previous version of the .NET Framework on non-Windows operating systems such as the Macintosh fails to preserve the directory structure. For example, on the Macintosh, it creates a set of files whose filename concatenates the directory path, along with any backslash (
) characters, and the filename. As a result, the directory structure of decompressed files is not preserved.
Note the problem may exist if the archiver used some old version of .NET Framework or if it didn't use it at all but implemented its own (independent) approach to zip files.
One may experience the same problem with rar: Unrar creating files with backslashes in names instead of proper directory hierarchy.
You may find this question on Unix & Linux SE helpful: Convert a Windows-created ZIP to Linux (internal paths issue). My (somewhat experimental) approach is in this answer.
It happens because some Windows tools apparently use backslashes () as separators where they should use forward slashes (
/
). Backslash in Unix can be a part of file or directory name.
.ZIP File Format Specification (version: 6.3.5 when I'm writing this, revised November 20, 2018) states:
4.4.17.1 The name of the file, with optional relative path.
The path stored MUST NOT contain a drive or
device letter, or a leading slash. All slashes
MUST be forward slashes/
as opposed to
backwards slashesfor compatibility with Amiga
and UNIX file systems etc. If input came from standard
input, there is no file name field.
This file is mentioned by Microsoft in a document Mitigation: ZipArchiveEntry.FullName
Path Separator:
Starting with apps that target the .NET Framework 4.6.1, the path separator used in the
ZipArchiveEntry.FullName
property has changed from the backslash () used in previous versions of the .NET Framework to a forward slash (
/
). [...]
Impact
The change brings the .NET implementation into conformity with section 4.4.17.1 of the .ZIP File Format Specification and allows .ZIP archives to be decompressed on non-Windows systems.
Decompressing a zip file created by an app that targets a previous version of the .NET Framework on non-Windows operating systems such as the Macintosh fails to preserve the directory structure. For example, on the Macintosh, it creates a set of files whose filename concatenates the directory path, along with any backslash (
) characters, and the filename. As a result, the directory structure of decompressed files is not preserved.
Note the problem may exist if the archiver used some old version of .NET Framework or if it didn't use it at all but implemented its own (independent) approach to zip files.
One may experience the same problem with rar: Unrar creating files with backslashes in names instead of proper directory hierarchy.
You may find this question on Unix & Linux SE helpful: Convert a Windows-created ZIP to Linux (internal paths issue). My (somewhat experimental) approach is in this answer.
answered Dec 12 '18 at 6:29
Kamil MaciorowskiKamil Maciorowski
24.8k155277
24.8k155277
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1382839%2fzip-files-expand-with-backslashes-on-linux-no-subdirectories%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Yeah, but I want to know why this happens, rather than the fact that it happens on two more or less disparate tools
– jaked122
Dec 12 '18 at 5:17