0

I'm trying to generate several thousand mutated files for filesystem fuzzing a few applications. Oddly enough when I get to generating file# 25510 I always get an IOError 13 Permission denied for some unknown reason.

Things to keep in mind.

  1. I'm using a Ramdisk image as generating multiple thousands of files on a SSD will kill them quickly.
  2. I'm using Windows 7 x64 in VMWare Workstation 11. started by giving it 4GBs of RAM, then upped it to 8GBs to ensure it didn't run out of RAM while running the program.
  3. Using Python 2.7

The code to generate the files is extremely simple:

(the string written has been changed to "Hello" for simplicity's sake and even this will fail on the 25510th file write)

 for x in range(0, 200000):
      with open("%s_test.txt" % x, "w") as f:
           f.write("Hello")
           f.close()

I have tried to increase the amount of RAM for the VM, but when running resource monitor, i didn't even get close to making out on 4GBs. The the filesize of the RamDisk image is nowhere near close to being full. Still have over 900MBs of space to write files that do not exceed 2Kbs. I can't seem to figure out why it gets to 25510 and then throws this error.

Thanks in advance!

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
resrever
  • 1
  • 1
  • Have you checked [this post](https://stackoverflow.com/questions/10575750/python-ioerror-errno-13-permission-denied)? – Casey May 23 '17 at 01:51
  • @resrever side note: you don't have to manually close the file if you're using the `with` statement. – Taku May 23 '17 at 01:55
  • 1
    This look like a ramdrive or file system issue. You should ask in a more system related sibling site of SO. – Klaus D. May 23 '17 at 01:56
  • Yes Casey, checked several of them, but it goes in numerical order. Klaus D. You are correct. I changed from using Dataram's Ramdisk to ltr-data's ramdisk software and generated all files without hitting the error like 2 seconds ago. abccd, thanks for that input! It might not sound like a lot, but when you do a ton of little files like i do and all the recursive loops, that will really save a lot of lines for me. Thanks again all! – resrever May 23 '17 at 02:19

0 Answers0