gos

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: MIT Imports: 4 Imported by: 0

README

gos 包

简介

gos 包提供了操作系统相关的工具函数。

功能特性

  • 进程信息:获取进程 ID、父进程 ID
  • 系统信息:获取系统类型、架构
  • 路径处理:处理操作系统相关路径

安装

go get github.com/snail007/gmc/util/os

相关链接

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempFile

func CreateTempFile(prefix, suffix string) (file *os.File, err error)

CreateTempFile creates a file in temp path, file name is randomly.

func IsMaxOS

func IsMaxOS() bool

IsMaxOS returns true indicates the os platform is Apple Mac OS. Others returns false.

func IsUnix

func IsUnix() bool

IsUnix returns true indicates the os platform is Unix or linux based System. Others returns false.

func IsWindows

func IsWindows() bool

IsWindows returns true indicates the os platform is Microsoft Windows. Others returns false.

func TempFile

func TempFile(prefix, suffix string) string

TempFile returns a path string, the path is join temp path and a random string. such as is: /tmp/prefix.xxx.suffix. xxx is a length 32 random string, prefix and suffix are arguments.

Types

This section is empty.

Jump to

Keyboard shortcuts

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