Golang os.File.Fd() function example
package os
Golang os.File.Fd() function usage example
file, err := os.Open("file.data")
if err != nil {
fmt.Println(err)
continue
}
fileDescriptor := int(file.Fd()) // get the unix descriptor
file.Close()
References :
http://golang.org/pkg/os/#File.Fd
http://www.theunixschool.com/2010/08/unix-file-descriptors.html
Advertisement
Something interesting
Tutorials
+10.7k Golang : Setup API server or gateway with Caddy and http.ListenAndServe() function example
+44.3k Golang : Read tab delimited file with encoding/csv package
+8.3k Golang : Web(Javascript) to server-side websocket example
+8.3k Golang : How to get garbage collection data?
+50.5k Golang : How to get struct field and value by name
+7.9k Golang : Capture text return from exec function example
+6.6k Golang : Convert source code to assembly language
+5.4k Golang : Map within a map example
+5.7k Golang : How to validate ISBN?
+7.7k Golang : Combine slices but preserve order example
+14.2k Golang : Get query string value on a POST request
+37.9k Golang : Remove dashes(or any character) from string