1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

doc: add doc for ZipAppendEntry

This commit is contained in:
dudaodong
2023-06-17 19:54:09 +08:00
parent 0fd268face
commit c8a536eafc
2 changed files with 58 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ import (
- [ReadFileToString](#ReadFileToString)
- [ReadFileByLine](#ReadFileByLine)
- [Zip](#Zip)
- [ZipAppendEntry](#ZipAppendEntry)
- [UnZip](#UnZip)
- [IsZipFile](#IsZipFile)
- [FileSize](#FileSize)
@@ -476,6 +477,34 @@ func main() {
}
```
### <span id="ZipAppendEntry">ZipAppendEntry</span>
<p>Append a single file or directory by fpath to an existing zip file.</p>
<b>Signature:</b>
```go
func ZipAppendEntry(fpath string, destPath string) error
```
<b>Example:</b>
```go
package main
import (
"fmt"
"github.com/duke-git/lancet/v2/fileutil"
)
func main() {
err := fileutil.ZipAppendEntry("./test.txt", "./test.zip")
if err != nil {
fmt.Println(err)
}
}
```
### <span id="UnZip">UnZip</span>
<p>Unzip the file and save it to dest path.</p>