archive/zip: support full range of FileMode flags

Zip files may actually store symlinks, and that's represented
as a file with unix flag S_IFLNK and with its data containing
the symlink target name.

The other flags are being supported too. Now that the os package
has the full range of flags in a system agnostic manner, there's
no reason to discard that information.

R=golang-dev, adg, rogpeppe
CC=golang-dev
https://golang.org/cl/5624048
This commit is contained in:
Gustavo Niemeyer 2012-02-06 11:58:32 -02:00
parent 419c53af30
commit 02fb021161
4 changed files with 71 additions and 17 deletions

View file

@ -69,8 +69,23 @@ var tests = []ZipTest{
},
},
},
{Name: "readme.zip"},
{Name: "readme.notzip", Error: ErrFormat},
{
Name: "symlink.zip",
File: []ZipTestFile{
{
Name: "symlink",
Content: []byte("../target"),
Mode: 0777 | os.ModeSymlink,
},
},
},
{
Name: "readme.zip",
},
{
Name: "readme.notzip",
Error: ErrFormat,
},
{
Name: "dd.zip",
File: []ZipTestFile{