Created
November 25, 2020 20:46
-
-
Save serkanalgur/ab822aec27e030f9fd18f93b14b1ec60 to your computer and use it in GitHub Desktop.
Open and Read File using phpfuncs module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/serkanalgur/phpfuncs" | |
) | |
func main(){ | |
var path = "/path/to/filename.extension" | |
// FOpen - func FOpen(file string, mode int) (*os.File, error) | |
f, _ := phpfuncs.FOpen(path,os.O_RDWR) | |
// FRead - func FRead(f *os.File, sb int64) string | |
fmt.Print(phpfuncs.FRead(f,512)) | |
// FClose - func FClose(file *os.File) error | |
phpfuncs.FClose(f) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment