From 7f0ac55978065289cd63b08e38ba60382f7436d7 Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Thu, 11 Mar 2021 11:11:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20Seek=20=E6=96=B9=E6=B3=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- .../Development/Language/Go/Basic/Go_文件操作.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Software/Development/Language/Go/Basic/Go_文件操作.md b/Software/Development/Language/Go/Basic/Go_文件操作.md index d3809dc..36debf7 100644 --- a/Software/Development/Language/Go/Basic/Go_文件操作.md +++ b/Software/Development/Language/Go/Basic/Go_文件操作.md @@ -73,6 +73,18 @@ func (f *File) Read(b []byte) (n int, err error) func (f *File) Write(b []byte) (n int, err error) ``` +### 1.6.设置读写位置 + +```go +/** + * @param whence + * os.SEEK_SET: seek relative to the origin of the file + * os.SEEK_CUR: seek relative to the current offset + * os.SEEK_END: seek relative to the end + */ +func (f *File) Seek(offset int64, whence int) (ret int64, err error) +``` + ## 2.ioutil 包 ### 2.1.读取