touch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT-0 Imports: 4 Imported by: 0

Documentation

Overview

change file access and modification times.

SYNOPSIS

touch [-acm] [-d ccyy-mm-ddTHH:MM:SS[.frac][Z]] [-r FILE] FILE ...

DESCRIPTION

touch sets the modification and access times of files to the current time of day. If the file doesn't exist, it is created with default permissions.

The options are as follows:

-a        Change the access time of the file.

-c        Do not create missing files, or display an error when a
          file is either missing or not created.

-d        Change the access and modified times of the file, using
          ISO8601/RFC3339Nano format.

-m        Change the modified time of the file.

-r        Use the access and modified times of the reference file
          rather than the current date-time.

SEE ALSO

https://golang.org/pkg/time/#pkg-constants
https://golang.org/pkg/os/#Chtimes
https://golang.org/pkg/time/#Unix

REFERENCES

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Access    bool
	Create    bool
	Date      string
	Modified  bool
	Reference string
}

func (*Options) Touch

func (opt *Options) Touch(operands []string) error

Touch ...

type Opts

type Opts func(*Options)

func Access

func Access(access bool) Opts

func Create

func Create(create bool) Opts

func Date

func Date(Date string) Opts

func Modified

func Modified(modified bool) Opts

func Reference

func Reference(reference string) Opts

Jump to

Keyboard shortcuts

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