file

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Overview

Package file contains functions for working with files and directories on the local filesystem

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeFileMode

func NormalizeFileMode(mode os.FileMode) os.FileMode

NormalizeFileMode converts the given mode to a mode that will work as expected on the given OS. A no-op on non-Windows OSes, but on Windows modes work differently - only the owner read/write bits are honoured (i.e. the 0200 mask).

func Read

func Read(filename string) (string, error)

Read the contents of the referenced file, as a string.

func ReadDir

func ReadDir(path string) ([]string, error)

ReadDir gets a directory listing.

func Write

func Write(filename string, content []byte) error

Write the given content to the file, truncating any existing file, and creating the directory structure leading up to it if necessary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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