fsutils

package
v0.0.0-...-e9cf350 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

README

fsutils File System Utilities

This module contains some tooling to explore the content of a file-system.

Note For GitHub Readers

While the content of this module is managed in an internal repository, you may still submit PR's.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SearchByExtension

func SearchByExtension(rootPath string, ext string) ([]string, error)

SearchByExtension Given a path, returns all sub-paths to files that have the specified extension 'ext'. Note that 'ext' must include a dot.

func SearchByFileName

func SearchByFileName(rootPath string, baseName string) ([]string, error)

SearchByFileName Given a path, returns all sub-paths to files that are named exactly like fileName rootPath must be absolute TODO some thing that supports "real" globs would be nice.

func SearchByFileNameRegex

func SearchByFileNameRegex(rootPath string, baseNameRegex string) ([]string, error)

SearchByFileNameRegex Given a path, returns all sub-paths to files that have names that match the passed regex. rootPath must be absolute TODO some thing that supports "real" globs would be nice.

func SearchClosestParentContaining

func SearchClosestParentContaining(startPath string, contains string) (string, error)

SearchClosestParentContaining returns the closest parent (which may be 'startPath' itself) that contains a file or directory named 'contains'. Note that the name must match exactly. startPath may be relative or absolute. On success, it will return an absolute path to a directory containing something named 'contain'

Types

This section is empty.

Jump to

Keyboard shortcuts

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