Skip to content

Commit 2e2eb7c

Browse files
committed
docs: add file.size and file.write documents
Signed-off-by: peefy <[email protected]>
1 parent 4d8a2e8 commit 2e2eb7c

File tree

2 files changed

+24
-0
lines changed
  • i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model
  • versioned_docs/version-0.8/reference/model

2 files changed

+24
-0
lines changed

i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/file.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,15 @@ weight: 100
6565
`mv(src: str, dest: str)`
6666

6767
将文件或目录从源路径移动到目标路径。
68+
69+
## size
70+
71+
`size(filepath: str) -> int`
72+
73+
获取指定路径上文件的大小。
74+
75+
## write
76+
77+
`write(filepath: str, content: str)`
78+
79+
将内容写入指定路径的文件。如果文件不存在,将会被创建。如果文件存在,其内容将被替换。

versioned_docs/version-0.8/reference/model/file.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,15 @@ Copy a file or directory from the source path to the destination path.
6565
`mv(src: str, dest: str)`
6666

6767
Move a file or directory from the source path to the destination path.
68+
69+
## size
70+
71+
`size(filepath: str) -> int`
72+
73+
Get the size of a file at the specified path.
74+
75+
## write
76+
77+
`write(filepath: str, content: str)`
78+
79+
Write content to a file at the specified path. If the file doesn't exist, it will be created. If it does exist, its content will be replaced.

0 commit comments

Comments
 (0)