Initial import

This commit is contained in:
Your Name 2018-08-20 21:04:45 +00:00
parent 258b52017a
commit c6ed1a115b
2 changed files with 35 additions and 0 deletions

BIN
fill Executable file

Binary file not shown.

35
fill.go Normal file
View File

@ -0,0 +1,35 @@
package main
import (
"fmt"
"io"
"log"
"os"
)
func main() {
var buf [1048576]byte
fd, err := os.Open("/dev/urandom")
if err != nil {
log.Fatal("Couldn't open urandom, " + err.Error())
}
count, err := io.ReadFull(fd, buf[:])
if err != nil || count != len(buf) {
log.Fatal("COuldn't read bytes, " + err.Error())
}
fd.Close()
i := 0
total := 0
fd, err = os.Create("tmp.dat")
for {
i, err = fd.Write(buf[:])
if err != nil || i != 1048576 {
fmt.Printf("EOF at %dmb, %s\n", total, err.Error())
fd.Close()
os.Remove("tmp.dat")
log.Fatal("End")
}
total++
}
}