CreateLink
为文件或目录创建软链接(符号链接 symlink)。
- 路由:
POST /files - action:
CreateLink
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 CreateLink |
| sfile | 是 | String | 源文件或目录的绝对路径 |
| dfile | 是 | String | 软链接目标路径(绝对路径),文件名仅允许 [\w\-\.]+ |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 创建成功 |
| msg | String | 软链文件创建成功! |
示例
请求
POST /files HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=CreateLink&sfile=/www/wwwroot/testapi.bt.local&dfile=/tmp/bt_link_test
响应
{"status": true, "msg": "软链文件创建成功!"}