fsext

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2026 Teradata

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package fsext provides filesystem extensions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base(path string) string

Base returns the base name.

func Dir

func Dir(path string) string

Dir returns the directory name.

func DirTrim

func DirTrim(path string, maxLen int) string

DirTrim returns a trimmed directory path.

func Exists

func Exists(path string) bool

Exists checks if a path exists.

func Ext

func Ext(path string) string

Ext returns the file extension.

func IsDir

func IsDir(path string) bool

IsDir checks if a path is a directory.

func ListDirectory

func ListDirectory(path string, exclude []string, depth, limit int) ([]string, bool, error)

ListDirectory lists files in a directory with optional filtering and limits. The exclude parameter can be a list of patterns to exclude. Returns file paths, truncated flag, and error.

func PrettyPath

func PrettyPath(path string) string

PrettyPath returns a pretty-formatted path.

func ToUnixLineEndings

func ToUnixLineEndings(s string) (string, bool)

ToUnixLineEndings converts Windows line endings to Unix. Returns the converted string and true if successful.

Types

type FileEntry

type FileEntry struct {
	Name  string
	Path  string
	IsDir bool
}

FileEntry represents a file or directory entry.

Jump to

Keyboard shortcuts

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