utils

package module
v0.0.0-...-3ed6912 Latest Latest
Warning

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

Go to latest
Published: May 25, 2019 License: MIT Imports: 4 Imported by: 1

README

goutils

utils functions for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) bool

Warning: this function will work correctly if there is priviledge to access 'path'

func FileMove

func FileMove(sourcePath, destPath string) error

https://stackoverflow.com/questions/50740902/move-a-file-to-a-different-drive-with-go

  1. os.Rename(source, destination) will not work for different Driver
  2. use io.Copy() rather than ioutil.ReadFile(), since Using ioutil.ReadFile is generally fine for smaller files, but it does copy the entire file into a slice. This means means that "moving" a large file will take lots of memory if you use those functions. io.Copy can even make use of kernel-specific syscalls that avoid loading the file into userspace at all. You should use io.Copy. ioutil. ReadFile` reads the entire file into memory at one time. It's only good for small filles.

func GetProcessName

func GetProcessName() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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