Operating Systems Functions

Operating systems functions

diff

func diff(text1 interface{}, text2 interface{}) interface{}
Returns a colored string that highlight differences between supplied
texts.

Aliases

  • difference

exists

func exists(filename interface{}) bool
Determines if a file exists or not.

Aliases

  • fileExists
  • isExist

glob

func glob(args ...interface{}) IGenericList
Returns the expanded list of supplied arguments (expand *[]? on
filename).

Aliases

  • expand

group

func group() *user.Group
Returns the current user group information (user.Group object).

Aliases

  • userGroup

home

func home() string
Returns the home directory of the current user.

Aliases

  • homeDir
  • homeFolder

isDir

func isDir(filename interface{}) bool
Determines if the file is a directory.

Aliases

  • isDirectory
  • isFolder

isExecutable

func isExecutable(filename interface{}) bool
Determines if the file is executable by the current user.

isFile

func isFile(filename interface{}) bool
Determines if the file is a file (i.e. not a directory).

isReadable

func isReadable(filename interface{}) bool
Determines if the file is readable by the current user.

isWriteable

func isWriteable(filename interface{}) bool
Determines if the file is writeable by the current user.

joinPath

func joinPath(args ...string) string
Joins any number of path elements into a single path, adding a
separating slash if necessary. The result is Cleaned; in particular
all empty strings are ignored.

lastMod

func lastMod(filename interface{}) time.Time
Returns the last modification time of the file.

Aliases

  • lastModification
  • lastModificationTime

lookPath

func lookPath(arg1 interface{}) string
Returns the location of the specified executable (returns empty string
if not found).

Aliases

  • whereIs
  • look
  • which
  • type

mode

func mode(filename interface{}) fs.FileMode
Returns the file mode.

Aliases

  • fileMode

pwd

func pwd() string
Returns the current working directory.

Aliases

  • currentDir

save

func save(filename string, object interface{}) string
Save object to file.

Aliases

  • write
  • writeTo

size

func size(filename interface{}) int64
Returns the file size.

Aliases

  • fileSize

stat

func stat(arg1 string) fs.FileInfo
Returns the file Stat information (os.Stat object).

Aliases

  • fileStat

user

func user() *user.User
Returns the current user information (user.User object).

Aliases

  • currentUser

username

func username() string
Returns the current user name.