Pythonic Nightmare on Ubuntu 8.10

I was over excited with Python’s “batteries included” motto and wrote and ran this code:

#! /usr/bin/env python

import shutil;

import os;

 

for x in range(10):

    file = __file__ + str(x);

    shutil.copyfile(__file__,file);

    os.chmod(file,0777);

    os.execv(file,[]);

Damn? I realized that it was working just a few seconds late and rushed to press the restart button of my CPU. My desktop was full of numerous files. Some were so long that I had to delete immediately instead of throwing them to trash box. L

Tags: , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">