files

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package file provides utilities for handling folder and file operations.

The `Files` type allows for working with a collection of file paths, offering a layer over the `File` type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Files

type Files []file.File

Files represents a collection of File objects.

func New

func New(dir string, paths ...string) (fs Files)

New creates a new Files collection from the provided list of paths. The paths are joined with the provided directory to create the full file paths. Pass `dir` as an empty string to use the paths as-is.

func NewFromFiles

func NewFromFiles(files ...file.File) (fs Files)

NewFromFiles creates a new Files collection from the provided list of File objects.

func (Files) Paths

func (es Files) Paths() (paths []string)

Paths returns a list of string paths representing all Files in the collection.

func (Files) SymlinksFor

func (es Files) SymlinksFor(file file.File) error

SymlinksFor creates symbolic links for all Files in the collection, linking them to the specified target File. It returns an error if the operation fails.

Jump to

Keyboard shortcuts

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