I'm trying to write a python script which will traverse through a directory recursively and create files of different sizes inside all of them. So far I have reached here. Well I haven't written any mechanism for creating files with different sizes but I need it. I very well know there's something wrong with the file creation logic I have written. Any help is highly appreciable.
My code:
#!/usr/bin/python
import os
import uuid
for dirs in os.walk('/home/zarvis'):
print dirs
filename = str(uuid.uuid4())
size = 1000000
with open(filename, "wb") as f:
f.write(" " * size)