cmd

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirPerm  = 0o700 // rwx------
	FilePerm = 0o600 // rw-------
)

File permission constants

Variables

This section is empty.

Functions

func ChangeDirectory added in v0.3.23

func ChangeDirectory(dir, swapDir, filename string) string

ChangeDirectory modifies a file path by changing its directory prefix. If the filename starts with swapDir, it replaces it with dir. Otherwise, it prepends dir to the path.

func Execute

func Execute()

func FileExists added in v0.3.23

func FileExists(filename string) bool

FileExists checks if a file exists and is a regular file (not a directory).

func WriteToFile

func WriteToFile(source []byte, file string) error

WriteToFile writes data to a file, creating directories as needed. It creates parent directories with DirPerm and the file with FilePerm.

Types

This section is empty.

Jump to

Keyboard shortcuts

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