This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| def make_random_file(path, target_size_bytes, chunk_size=1024 * 1024): | |
| """ | |
| Create a file filled with random bytes until it reaches target_size_bytes. | |
| chunk_size just controls memory use while streaming!!!! | |
| 1 = Byte 1 KB = 1024**1, 1 MB = 1024**2, 1 GB = 1024**3 | |
| """ |