mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
419c53af30
commit
02fb021161
4 changed files with 71 additions and 17 deletions
|
|
@ -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{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue