Documentation ¶
Index ¶
- func CopyWithContext(ctx context.Context, dst io.Writer, src io.Reader) (err error)
- func DefaultBytes(maxBytes int64, description string) *progressbar.ProgressBar
- func MkExclDir(stem string) (name string, err error)
- func NewLogger(i, n int, name flags.Filename) *log.Logger
- func OpenExclFile(stem, ext string) (file *os.File, err error)
- func SplitStemAndExt(name string) (stem string, ext string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyWithContext ¶
CopyWithContext is a custom implementation of io.Copy that is cancellable.
func DefaultBytes ¶
DefaultBytes is equivalent to progressbar.DefaultBytes but with higher progressbar.OptionThrottle.
func MkExclDir ¶
MkExclDir creates a new directory with the condition that the directory did not exist prior to this call.
Stem is the desired name of the directory. The actual directory that is created might have numeric suffixes in its name which is the first return value.
func OpenExclFile ¶
OpenExclFile creates a new file for writing with the condition that the file did not exist prior to this call.
The first string should be the stem of the filename, the second the extension. If filename is "hello world.txt" then the stem is "hello world", ext is ".txt". See os.O_EXCL. Caller is responsible for closing the file upon a successful return.
func SplitStemAndExt ¶
SplitStemAndExt splits the given name into the stem and extension part.
The extension starts at the final dot. If there is no dot, ext is empty string.
Types ¶
This section is empty.