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
+11.6k SSL : The certificate is not trusted because no issuer chain was provided
+15.2k Golang : How to add color to string?
+16.5k Golang : Send email and SMTP configuration example
+12.1k Golang : Convert a rune to unicode style string \u
+5.8k Fix yum-complete-transaction error
+9.6k Golang : Changing a RGBA image number of channels with OpenCV
+7.8k Golang : Generate human readable password
+6.2k Fix ERROR 2003 (HY000): Can't connect to MySQL server on 'IP address' (111)
+5.7k PHP : Convert string to timestamp or datestamp before storing to database(MariaDB/MySQL)
+11.5k Golang : Delay or limit HTTP requests example
+5.8k Unix/Linux/MacOSx : Get local IP address
+7.2k Golang : A simple forex opportunities scanner