The library is able to deserialize Header structs from Symlink files:
|
// read link name |
|
if hdr.Mode&^ModePerm == ModeSymlink { |
|
if hdr.Size < 1 || hdr.Size > svr4MaxNameSize { |
|
return nil, ErrHeader |
|
} |
|
b := make([]byte, hdr.Size) |
|
if _, err := io.ReadFull(r, b); err != nil { |
|
return nil, err |
|
} |
|
hdr.Linkname = string(b) |
|
hdr.Size = 0 |
|
} |
However, it completely ignores the Linkname attribute while writing the header, resulting in zero-sized files without target.
Note that using writer.Write(target) as a workaround isn't an option because the method isn't supported for files other than Regular:
|
// Calling Write on special types like TypeLink, TypeSymlink, TypeChar, |
|
// TypeBlock, TypeDir, and TypeFifo returns (0, ErrWriteTooLong) regardless of |
|
// what the Header.Size claims. |
The library is able to deserialize
Headerstructs from Symlink files:cpio/svr4.go
Lines 90 to 101 in b4d3577
However, it completely ignores the
Linknameattribute while writing the header, resulting in zero-sized files without target.Note that using
writer.Write(target)as a workaround isn't an option because the method isn't supported for files other than Regular:cpio/writer.go
Lines 103 to 105 in b4d3577