files

package module
v0.0.0-...-4d1a7d7 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

README

files

Package files offers some convenience functions for handling files and file paths.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Sanitize func(s string) string = strings.NewReplacer("\\", " ", "/", " ", ":", "", "*", "", "?", "", "\"", "", "<", "", ">", "", "|", "", "\t", "", "\n", "").Replace

Sanitize returns s with characters that are considered unsafe in file paths removed.

Functions

func Exists

func Exists(path string) bool

Exists reports whether a file exists at path.

func Move

func Move(path string, destination string) error

Move attempts to rename the file first, and if this did not work due to the locations being on different devices it copies and deletes.

func NameWithoutExt

func NameWithoutExt(path string) string

NameWithoutExt returns path without the file extension.

Types

This section is empty.

Jump to

Keyboard shortcuts

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