Golang net.FileListener() and os.NewFile() functions example
package net
Golang net.FileListener() and os.NewFile() functions usage example
file := os.NewFile(3, "")
ln, err = net.FileListener(file)
NOTE : From the source code ( https://golang.org/src/os/file_unix.go?s=1063:1106#L31 ) ... NewFile does not create a new file, all it does is to setup a Go os.File wrapper with the given file descriptor (see http://www.theunixschool.com/2010/08/unix-file-descriptors.html )
References :
https://golang.org/src/os/file_unix.go?s=1063:1106#L31
http://www.theunixschool.com/2010/08/unix-file-descriptors.html
Advertisement
Something interesting
Tutorials
+13.6k Golang : reCAPTCHA example
+10.2k Golang : How to profile or log time spend on execution?
+7.1k Golang : Validate credit card example
+14.8k Golang : Adding XML attributes to xml data or use attribute to differentiate a common tag name
+8.4k Golang : Convert word to its plural form example
+6.7k Golang : When to use make or new?
+7.6k Golang : Convert(cast) io.Reader type to string
+9.1k Golang : Serving HTTP and Websocket from different ports in a program example
+13.7k Golang : Check if an integer is negative or positive
+22.5k Golang : Convert Unix timestamp to UTC timestamp
+4.7k Golang : How to pass data between controllers with JSON Web Token
+24.5k Golang : Time slice or date sort and reverse sort example