fileutil

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

TODO: this package shouldn't really exist. we can usually just attempt our normal filesystem operations and handle errors atomically. eg. - Safe could instead be try create file, handle error - Unique could be try create file, on err create file (1), etc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func First

func First(path ...string) (string, error)

func HasPrefix added in v0.16.3

func HasPrefix(p, prefix string) bool

HasPrefix checks a path has a prefix, making sure to respect path boundaries. So that /aa & /a does not match, but /a/a & /a does.

func Safe

func Safe(filename string) string

func Unique

func Unique(base, filename string) (string, error)

try to find a unqiue file (or dir) name. incrementing like "example (1)"

Types

This section is empty.

Jump to

Keyboard shortcuts

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