Sha256: 3a0cd2bd6dc698b755ec5ac84f53e85449655740026d1062dcc299da590495eb

Contents?: true

Size: 447 Bytes

Versions: 12

Compression:

Stored size: 447 Bytes

Contents

package main

import (
	"bytes"
	"log"
	"os/exec"
	"strings"
)

var statFile = func(path string) string {
	cmd := exec.Command("stat", "-c", "%U:%G", path)
	var out bytes.Buffer
	cmd.Stdout = &out
	err := cmd.Run()
	if err != nil {
		log.Fatal(err)
	}

	return strings.Trim(out.String(), "\n")
}

func getFileOwnerGroup(path string) (user, group string) {
	split := strings.Split(statFile(path), ":")
	user = split[0]
	group = split[1]

	return
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
machinery-tool-1.24.1 machinery-helper/file_utils.go
machinery-tool-1.24.0 machinery-helper/file_utils.go
machinery-tool-1.23.1 machinery-helper/file_utils.go
machinery-tool-1.23.0 machinery-helper/file_utils.go
machinery-tool-1.22.3 machinery-helper/file_utils.go
machinery-tool-1.22.2 machinery-helper/file_utils.go
machinery-tool-1.22.1 machinery-helper/file_utils.go
machinery-tool-1.22.0 machinery-helper/file_utils.go
machinery-tool-1.21.0 machinery-helper/file_utils.go
machinery-tool-1.20.0 machinery-helper/file_utils.go
machinery-tool-1.19.0 machinery-helper/file_utils.go
machinery-tool-1.18.0 machinery-helper/file_utils.go