Skip to content

Instantly share code, notes, and snippets.

@draganHR
Created December 13, 2013 15:20
Show Gist options
  • Save draganHR/7945813 to your computer and use it in GitHub Desktop.
Save draganHR/7945813 to your computer and use it in GitHub Desktop.
Generate random files
import time
import os
FILE_COUNT = 50
FILE_SIZE = 1 * 1024 * 1024
PATH = "/tmp/random-files"
TIME = time.time()
os.system("mkdir -p %s" % PATH)
os.system("rm -f %s/*" % PATH)
for i in range(FILE_COUNT):
print "%s..." % i
f = open("%s/%s-%s.bin" % (PATH, TIME, i), "w")
f.write(os.urandom(FILE_SIZE))
f.close()
print "Created %s files in %s" % (FILE_COUNT, PATH)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment