fileutil

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package fileutil provides utilities for file and directory processing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileStats

func GetFileStats(files []FileInfo) map[string]interface{}

GetFileStats returns statistics about a set of files

func IsTextFile

func IsTextFile(path string) (bool, error)

IsTextFile determines if a file is likely to be a plain text file

func ReadFileContent

func ReadFileContent(path string) (string, error)

ReadFileContent reads the content of a file safely

func WriteFileContent

func WriteFileContent(path, content string) error

WriteFileContent writes content to a file safely

Types

type FileInfo

type FileInfo struct {
	Path         string
	RelativePath string
	IsText       bool
	Size         int64
}

FileInfo represents information about a file to be processed

func FindTextFiles

func FindTextFiles(rootPath string) ([]FileInfo, error)

FindTextFiles recursively finds all text files in a directory

Jump to

Keyboard shortcuts

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