You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/weili71/go-filex

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/weili71/go-filex

v0.0.0-20230321132739-7a825b3f5691
Source
Go
Version published
Created
Source

go-filex

golang file扩展库 此库旨在简化golang文件操作,api与java.lang.File类似

安装:

go get github.com/wilinz/go-filex

例子:

package main

import (
	"filex"
	"fmt"
	"os"
)

func main() {
	file:=filex.NewFile("c://")
	for _, f := range file.ListFiles() {
		fmt.Println(f.CanonicalPath())
	}
	textFile:=filex.NewFile2(file,"test.txt")
	osFile, _ :=textFile.OpenFile(os.O_RDWR,0755)
	textFile.AppendText(osFile,"hello!\n")
	osFile.Close()
}

FAQs

Package last updated on 21 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts