Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultDirMode = 0755 DefaultFileMode = 0644 )
Variables ¶
This section is empty.
Functions ¶
func EnsureDirExists ¶
EnsureDirExists 确保指定路径的目录存在,如果不存在则递归创建
参数:
- path: 目录路径
返回值:
- error: 路径无效、创建失败或路径非目录时返回错误
func EnsureFileDirExists ¶
EnsureFileDirExists 确保文件所在的目录存在
参数:
- filePath: 文件路径(如 `/data/logs/file.txt`)
返回值:
- error: 目录创建失败或路径非目录时返回错误
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.