isexecutable

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: MIT Imports: 5 Imported by: 0

README

go-isexecutable

Lib for go to check if a given reader is an executable file.

Usage

package main

import (
	"github.com/ArthurHlt/go-isexecutable"
	"os"
	"fmt"
)

func main() {
	f, _ := os.Open("my-file-executable")
	// if closeAfterCheck is true and reader is a closable reader
	// isexecutable will close itself the reader after reading the first 4bytes of your file
	fmt.Println(isexecutable.IsExecutable(f, true))
	// show true
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExecutable

func IsExecutable(reader io.Reader, closeAfterCheck bool) bool

check if source is an executable file

Types

This section is empty.

Jump to

Keyboard shortcuts

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