Do_not_remove.txt



  • So I just discovered a previously unnoticed directory in one of our sites. It's called "uploads" and contains three things: two stock images of microphones, called "audio.jpg" and "audio2.jpg" and an empty text file called "do_not_remove.txt". Some days this code almost makes sense, but then it all falls apart.

    Anyway, I think I'm going to delete it. What's the worst that could happen?


  • Considered Harmful

    @mikeTheLiar said:

    What's the worst that could happen?

    The application searches for do_not_remove.txt, so that it knows what directory to put its files in. It can't find it, but since it's written in Go, it doesn't have exceptions. Instead, it blindly appends the path (empty string) to C:\, resulting in C:\ becoming the new upload directory. It then proceeds to clean up the upload directory by deleting every file and subdirectory created more than 30 days ago, which happens to be all of them. Since the directory structure contains a junction point to a parent directory, this process runs forever and heats the CPU to abnormal levels. Then the server catches fire, the fire spreads to a nearby children's hospital, and animal clinic for cute kittens. Then, when the fire reaches a nearby gas station, the resulting explosion triggers a false alarm for a foreign nuclear strike. The dead man's switch automatically launches several nukes at all other nuclear-armed countries, who respond in kind. After decades of nuclear winter, all life on earth is eventually extinguished.



  • @joe.edwards said:

    After decades of nuclear winter, all life on earth is eventually extinguished.

    Now now, there are micro organisms that live in undersea vents that wouldn't be killed off as their thermal source is the planetary core.



  • @joe.edwards said:

    @mikeTheLiar said:
    What's the worst that could happen?

    The application searches for do_not_remove.txt, so that it knows what directory to put its files in. It can't find it, but since it's written in Go, it doesn't have exceptions. Instead, it blindly appends the path (empty string) to C:\, resulting in C:\ becoming the new upload directory. It then proceeds to clean up the upload directory by deleting every file and subdirectory created more than 30 days ago, which happens to be all of them. Since the directory structure contains a junction point to a parent directory, this process runs forever and heats the CPU to abnormal levels. Then the server catches fire, the fire spreads to a nearby children's hospital, and animal clinic for cute kittens. Then, when the fire reaches a nearby gas station, the resulting explosion triggers a false alarm for a foreign nuclear strike. The dead man's switch automatically launches several nukes at all other nuclear-armed countries, who respond in kind. After decades of nuclear winter, all life on earth is eventually extinguished.

    O the embarrassment.

     



  •  @joe.edwards said:

    ...but since it's written in Go ...

    In this scenario, the worst has already happened.

     



  • @mikeTheLiar said:


    So I just discovered a previously unnoticed directory in one of our sites. It's called "uploads" and contains three things: two stock images of microphones, called "audio.jpg" and "audio2.jpg" and an empty text file called "do_not_remove.txt". Some days this code almost makes sense, but then it all falls apart.

    Anyway, I think I'm going to delete it. What's the worst that could happen?

    LESS MAGIC


  • Considered Harmful

    I've actually seen this used before to stop deployment tools (aka robocopy) from culling it as an empty directory.



  • @joe.edwards said:

    I've actually seen this used before to stop deployment tools (aka robocopy) from culling it as an empty directory.

    It's a lot more convenient than typing that nasty /E in the command line.



  • @joe.edwards said:

    @mikeTheLiar said:
    What's the worst that could happen?

    The application searches for do_not_remove.txt, so that it knows what directory to put its files in. It can't find it, but since it's written in Go, it doesn't have exceptions. Instead, it blindly appends the path (empty string) to C:\, resulting in C:\ becoming the new upload directory. It then proceeds to clean up the upload directory by deleting every file and subdirectory created more than 30 days ago, which happens to be all of them. Since the directory structure contains a junction point to a parent directory, this process runs forever and heats the CPU to abnormal levels. Then the server catches fire, the fire spreads to a nearby children's hospital, and animal clinic for cute kittens. Then, when the fire reaches a nearby gas station, the resulting explosion triggers a false alarm for a foreign nuclear strike. The dead man's switch automatically launches several nukes at all other nuclear-armed countries, who respond in kind. After decades of nuclear winter, all life on earth is eventually extinguished.

    Damn. I guess that would make me the worst of the worst.


  • @mikeTheLiar said:

    @joe.edwards said:
    @mikeTheLiar said:
    What's the worst that could happen?

    The application searches for do_not_remove.txt, so that it knows what directory to put its files in. It can't find it, but since it's written in Go, it doesn't have exceptions. Instead, it blindly appends the path (empty string) to C:\, resulting in C:\ becoming the new upload directory. It then proceeds to clean up the upload directory by deleting every file and subdirectory created more than 30 days ago, which happens to be all of them. Since the directory structure contains a junction point to a parent directory, this process runs forever and heats the CPU to abnormal levels. Then the server catches fire, the fire spreads to a nearby children's hospital, and animal clinic for cute kittens. Then, when the fire reaches a nearby gas station, the resulting explosion triggers a false alarm for a foreign nuclear strike. The dead man's switch automatically launches several nukes at all other nuclear-armed countries, who respond in kind. After decades of nuclear winter, all life on earth is eventually extinguished.

    Damn. I guess that would make me the worst of the worst.
    And now you have come full circle.

     



  • @joe.edwards said:

    @mikeTheLiar said:
    What's the worst that could happen?

    The application searches for do_not_remove.txt, so that it knows what directory to put its files in. It can't find it, but since it's written in Go, it doesn't have exceptions. Instead, it blindly appends the path (empty string) to C:\, resulting in C:\ becoming the new upload directory. It then proceeds to clean up the upload directory by deleting every file and subdirectory created more than 30 days ago, which happens to be all of them. Since the directory structure contains a junction point to a parent directory, this process runs forever and heats the CPU to abnormal levels. Then the server catches fire, the fire spreads to a nearby children's hospital, and animal clinic for cute kittens. Then, when the fire reaches a nearby gas station, the resulting explosion triggers a false alarm for a foreign nuclear strike. The dead man's switch automatically launches several nukes at all other nuclear-armed countries, who respond in kind. After decades of nuclear winter, all life on earth is eventually extinguished.

    But since none of that is on your goals statement, we're all good.  Go for it.

     



  • @mikeTheLiar said:

    @joe.edwards said:
    @mikeTheLiar said:
    What's the worst that could happen?

    Everybody dies.

    Damn. I guess that would make me the worst of the worst.


  • @mikeTheLiar said:

    Damn. I guess that would make me the worst of the worst.

    On the positive side, nobody would be around to make you feel bad about it.



  • @joe.edwards said:

    @mikeTheLiar said:
    What's the worst that could happen?

    The application searches for do_not_remove.txt, so that it knows what directory to put its files in. It can't find it, but since it's written in Go, it doesn't have exceptions. Instead, it blindly appends the path (empty string) to C:\, resulting in C:\ becoming the new upload directory. It then proceeds to clean up the upload directory by deleting every file and subdirectory created more than 30 days ago, which happens to be all of them. Since the directory structure contains a junction point to a parent directory, this process runs forever and heats the CPU to abnormal levels. Then the server catches fire, the fire spreads to a nearby children's hospital, and animal clinic for cute kittens. Then, when the fire reaches a nearby gas station, the resulting explosion triggers a false alarm for a foreign nuclear strike. The dead man's switch automatically launches several nukes at all other nuclear-armed countries, who respond in kind. After decades of nuclear winter, all life on earth is eventually extinguished.

    That should be the plot to Nic Cage's next film.



  • @mikeTheLiar said:


    So I just discovered a previously unnoticed directory in one of our sites. It's called "uploads" and contains three things: two stock images of microphones, called "audio.jpg" and "audio2.jpg" and an empty text file called "do_not_remove.txt". Some days this code almost makes sense, but then it all falls apart.

    Is any of the uploads folder under source control? If you're using a source control package like git that can't see empty folders, it's possible that somebody hardcoded the relative path of the uploads folder and committed that do_not_remove.txt file in order to have the uploads folder in source control, so that anybody checking out a copy of the webserver onto a new machine would automatically have a working uploads folder without needing to create one. Consider swapping it to a .gitkeep file instead of deleting it entirely if that's the case.



  • @Cabbage said:

    a source control package like git that can't see empty folders



  • @joe.edwards said:

    @mikeTheLiar said:
    What's the worst that could happen?

    The application searches for do_not_remove.txt, so that it knows what directory to put its files in. It can't find it, but since it's written in Go, it doesn't have exceptions. Instead, it blindly appends the path (empty string) to C:\, resulting in C:\ becoming the new upload directory. It then proceeds to clean up the upload directory by deleting every file and subdirectory created more than 30 days ago, which happens to be all of them. Since the directory structure contains a junction point to a parent directory, this process runs forever and heats the CPU to abnormal levels. Then the server catches fire, the fire spreads to a nearby children's hospital, and animal clinic for cute kittens. Then, when the fire reaches a nearby gas station, the resulting explosion triggers a false alarm for a foreign nuclear strike. The dead man's switch automatically launches several nukes at all other nuclear-armed countries, who respond in kind. After decades of nuclear winter, all life on earth is eventually extinguished.

    Don't let all life on earth be eventually extingushed.  Switch to Direct TV.



  • @El_Heffe said:

    That photo is a fake. That's obviously the head of a norwegian sissy and the body of a persian bath salts smuggler.



  • @mikeTheLiar said:

    Damn. I guess that would make me the worst of the worst.
    "The worst of the worst of the worst, sir!"



  •  @El_Heffe said:

    @Cabbage said:

    a source control package like git that can't see empty folders

    lol hilarious gif. for more richard stallman, alan turing, ada lovelace and linus torvalds dancing gifs (with catching music!), click here

     


Log in to reply