I need to create some large files and show the write progress in python. Currently I am using this code to create the file. But I can not show the progress. Python Write
function returns the number actually written at the end of write
operation. But I need to know how much byte is written in every second.
oneGB = 1024*1024*1024 # 1GB
with open('large_file', 'wb') as fout:
bytes_number = fout.write(os.urandom(oneGB))
print(bytes_number)
I know that I can get the expected result using dd
comand with progress
in linux, unfortunetly the system I am working doesn't support progress
as status flag for dd
command. I get this when try to run dd command.
dd: invalid status flag: `progress'
Here is my dd command:
dd if=/dev/zero of=temp_file status=progress count=1M bs=5120