fileutils

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChownR

func ChownR(path string, uid, gid int) error

рекурсивный chown

func Copy

func Copy(srcFile string, dstFile string) error

скопировать файл

func CopyDirectory

func CopyDirectory(srcDir, destDir string) error

cкопировать директорию

func CopySymLink(source, dest string) error

скопировать символьную ссылку

func CreateDirectoryIfNotExists

func CreateDirectoryIfNotExists(dir string, perm os.FileMode) error

создать директорию, если она не существует

func Exists

func Exists(filePath string) bool

проверить, существует ли файл

func NormalizeAbsolutePath added in v1.0.9

func NormalizeAbsolutePath(p string) (string, error)

нормализуем абсолютный путь

Types

type File added in v1.0.9

type File struct {
	// contains filtered or unexported fields
}

func Init added in v1.0.9

func Init(workDir, fileSubpath string) (*File, error)

инициализируем file

func (*File) Chmod added in v1.0.9

func (f *File) Chmod(mode os.FileMode) error

chmod

func (*File) CopyFileTo added in v1.0.9

func (f *File) CopyFileTo(dst *File) error

копируем файл

func (*File) Delete added in v1.0.9

func (f *File) Delete() error

удаляем файл

func (*File) GetPath added in v1.0.9

func (f *File) GetPath() string

получаем путь до файла

func (*File) Read added in v1.0.9

func (f *File) Read() (string, error)

читаем файл

func (*File) Write added in v1.0.9

func (f *File) Write(content []byte, append bool) error

пишем в файл

Jump to

Keyboard shortcuts

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