fs

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDirMode  = 0755
	DefaultFileMode = 0644
)

Variables

This section is empty.

Functions

func EnsureDirExists

func EnsureDirExists(path string) error

EnsureDirExists 确保指定路径的目录存在,如果不存在则递归创建

参数:

  • path: 目录路径

返回值:

  • error: 路径无效、创建失败或路径非目录时返回错误

func EnsureFileDirExists

func EnsureFileDirExists(filePath string) error

EnsureFileDirExists 确保文件所在的目录存在

参数:

  • filePath: 文件路径(如 `/data/logs/file.txt`)

返回值:

  • error: 目录创建失败或路径非目录时返回错误

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL