跳到主要内容
版本:latest

test_path

检测指定路径是否存在,返回路径、类型(目录/文件)和存在状态。

  • 路由POST /files
  • actiontest_path

输入参数

参数名称必选类型描述
actionString固定值 test_path
pathString要检测的路径

输出参数

参数名称类型描述
pathString路径
is_dirBooleantrue 为目录,false 为文件,null 为不存在
existsBoolean路径是否存在

示例

请求

POST /files HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded

action=test_path&path=/www/wwwroot

响应

{"path": "/www/wwwroot", "is_dir": true, "exists": true}