Skip to content

feat: add more docs for the file module #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/reference/model/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,27 @@ Whether this file path exists. Returns true if the path points at an existing en
`abs(filepath: str) -> str`

Returns the canonical, absolute form of the path with all intermediate components normalized and symbolic links resolved.

## mkdir

`mkdir(directory: str, exists: bool=False)`

Create a new directory at the specified path if it doesn't already exist.

## delete

`delete(directory: str, exists)`

Delete a file or an empty directory at the specified path.

## cp

`cp(src: str, dest: str)`

Copy a file or directory from the source path to the destination path.

## mv

`mv(src: str, dest: str)`

Move a file or directory from the source path to the destination path.
4 changes: 2 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const katex = require('rehype-katex');
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'KCL programming language.',
tagline: 'Mutation Validation Abstraction Production-Ready',
tagline: 'Mutation Validation Abstraction Automation Production-Ready',

url: 'https://kcl-lang.github.io',
url: 'https://www.kcl-lang.io',
organizationName: 'kcl-lang', // Usually your GitHub org/user name.
projectName: 'kcl', // Usually your repo name.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,27 @@ weight: 100
`abs(filepath: str) -> str`

返回路径的规范化绝对形式,其中所有中间路径均已规范化并解析为符号链接。

## mkdir

`mkdir(directory: str, exists: bool=False)`

如果指定路径上不存在目录,则创建一个新目录。

## delete

`delete(directory: str, exists)`

在指定路径上删除一个文件或空目录。

## cp

`cp(src: str, dest: str)`

将文件或目录从源路径复制到目标路径。

## mv

`mv(src: str, dest: str)`

将文件或目录从源路径移动到目标路径。
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,27 @@ weight: 100
`abs(filepath: str) -> str`

返回路径的规范化绝对形式,其中所有中间路径均已规范化并解析为符号链接。

## mkdir

`mkdir(directory: str, exists: bool=False)`

如果指定路径上不存在目录,则创建一个新目录。

## delete

`delete(directory: str, exists)`

在指定路径上删除一个文件或空目录。

## cp

`cp(src: str, dest: str)`

将文件或目录从源路径复制到目标路径。

## mv

`mv(src: str, dest: str)`

将文件或目录从源路径移动到目标路径。
24 changes: 24 additions & 0 deletions versioned_docs/version-0.8/reference/model/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,27 @@ Whether this file path exists. Returns true if the path points at an existing en
`abs(filepath: str) -> str`

Returns the canonical, absolute form of the path with all intermediate components normalized and symbolic links resolved.

## mkdir

`mkdir(directory: str, exists: bool=False)`

Create a new directory at the specified path if it doesn't already exist.

## delete

`delete(directory: str, exists)`

Delete a file or an empty directory at the specified path.

## cp

`cp(src: str, dest: str)`

Copy a file or directory from the source path to the destination path.

## mv

`mv(src: str, dest: str)`

Move a file or directory from the source path to the destination path.
Loading