From 4c0b0fbd85acb436faea99e5a889197caa3cdc55 Mon Sep 17 00:00:00 2001 From: xc Date: Thu, 23 Oct 2025 14:48:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=8E=8B=E7=BC=A9=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=BF=9D=E7=95=99=E5=8E=9F=E6=9C=89=E7=9A=84=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=92=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scagent/util/fsutil.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scagent/util/fsutil.go b/scagent/util/fsutil.go index 313238e..16b8800 100644 --- a/scagent/util/fsutil.go +++ b/scagent/util/fsutil.go @@ -385,6 +385,10 @@ func CompressToZip(dest string, currentPath string, paths []string) error { return err } defer f.Close() + // 保留文件的原有的时间 + header.Modified = info.ModTime() + // 保留文件的原有的权限 + header.SetMode(info.Mode()) _, err = io.Copy(headerWriter, f) return err })