python
with open("50M.dat", "wb") as outfile:
outfile.write(b'\x00' * 50 * 1024 * 1024)
# outfile.write(bytes(50 * 1024 * 1024))
go
package main
import (
"os"
"log"
)
func main() {
f, err := os.Create("50MB_go.dat")
if err != nil {
log.Fatal(err)
}
defer f.Close()
size := 50 * 1024 * 1024
bytes := make([]byte, size)
f.Write(bytes)
}
lua
outfile = io.open("50M.dat", "wb")
outfile:write(string.rep(string.char(0), 50 * 1024 * 1024))
outfile:close()