Home | History | Annotate | Download | only in zip

Lines Matching refs:fh

247 // for the file metadata. Writer takes ownership of fh and may mutate
248 // its fields. The caller must not modify fh after calling CreateHeader.
253 func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
259 if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh {
264 fh.Flags |= 0x8 // we will write a data descriptor
282 utf8Valid1, utf8Require1 := detectUTF8(fh.Name)
283 utf8Valid2, utf8Require2 := detectUTF8(fh.Comment)
285 case fh.NonUTF8:
286 fh.Flags &^= 0x800
288 fh.Flags |= 0x800
291 fh.CreatorVersion = fh.CreatorVersion&0xff00 | zipVersion20 // preserve compatibility byte
292 fh.ReaderVersion = zipVersion20
295 if !fh.Modified.IsZero() {
304 fh.ModifiedDate, fh.ModifiedTime = timeToMsDosTime(fh.Modified)
313 mt := uint32(fh.Modified.Unix())
319 fh.Extra = append(fh.Extra, mbuf[:]...)
327 comp := w.compressor(fh.Method)
339 FileHeader: fh,
345 if err := writeHeader(w.cw, fh); err != nil {
431 fh := w.header.FileHeader
432 fh.CRC32 = w.crc32.Sum32()
433 fh.CompressedSize64 = uint64(w.compCount.count)
434 fh.UncompressedSize64 = uint64(w.rawCount.count)
436 if fh.isZip64() {
437 fh.CompressedSize = uint32max
438 fh.UncompressedSize = uint32max
439 fh.ReaderVersion = zipVersion45 // requires 4.5 - File uses ZIP64 format extensions
441 fh.CompressedSize = uint32(fh.CompressedSize64)
442 fh.UncompressedSize = uint32(fh.UncompressedSize64)
451 if fh.isZip64() {
458 b.uint32(fh.CRC32)
459 if fh.isZip64() {
460 b.uint64(fh.CompressedSize64)
461 b.uint64(fh.UncompressedSize64)
463 b.uint32(fh.CompressedSize)
464 b.uint32(fh.UncompressedSize)