Jump to content




Computer Cleaner

command

9 replies to this topic

#1 Scoptile

  • Members
  • 36 posts
  • LocationYes. (Location does mean wanted in 12 countries, right?)

Posted 21 July 2015 - 08:34 AM

DISCLAIMER: I don't know if this counts as malicious! If it does please tell me! I do clearly say it deletes all files, because that's its purpose. If I'm right, malicious would be deleting all programs without making it clear that that's what it's doing, and giving the user a choice weather or not they want to do it. I'm going to make it clear that that's what it does:

THIS PROGRAM DELETES ALL THE FILES ON THE COMPUTER!!!! DON'T RUN IT IF YOU DON'T WANT ALL THE FILES ON THE COMPUTER YOU RUN IT ON TO BE DELETED PERMANENTLY!!!!

There.

If you are ever just testing stuff out on a computer, like I often do, then you might like this program! It will delete all the files on your computer except for itself. It's good for cleaning up programs that create a lot of files. I hope you enjoy :)

Run this program to install it on your computer:
pastebin get 8iDT0DLJ reset
MUST BE NAMED 'reset' OR IT WILL DELETE ITSELF

Run this program to run it once:
pastebin run 8iDT0DLJ
Note that if you have a program that is named 'reset', it will not be deleted.

#2 PokeAcer

  • Members
  • 143 posts

Posted 22 July 2015 - 02:19 PM

do you know what else does this? rm *

#3 biggest yikes

  • Members
  • 573 posts

Posted 22 July 2015 - 02:23 PM

As of CC 1.6, computers have implemented wildcards, so typing "delete *" in the computer would attempt to delete all the files.

#4 flaghacker

  • Members
  • 655 posts

Posted 22 July 2015 - 02:50 PM

You might want to check out shell.getRunningProgram to get the name of your program automatically so you don't have to name it 'reset'.

Don't worry about the fact it's already possible, keep learning!

Edited by flaghacker, 22 July 2015 - 02:50 PM.


#5 LewisTehMinerz

  • Members
  • 174 posts
  • LocationMinecraft in Minecraft in Minecraft in ComputerCraft... in Minecraft

Posted 22 July 2015 - 02:50 PM

@​Scoptile,

Just a word of notice,
(file ~= "reset")
could be changed to
(file ~= shell.getRunningProgram())

This will make it so that you don't need to have the file's name as "reset".

#6 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 22 July 2015 - 03:39 PM

Instead of checking for certain file names you can check if the file is read-only before deleting.

#7 hteee

  • New Members
  • 1 posts

Posted 22 July 2015 - 05:22 PM

View PostMKlegoman357, on 22 July 2015 - 03:39 PM, said:

Instead of checking for certain file names you can check if the file is read-only before deleting.
It would still do the exact same thing so there's no point?

#8 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 22 July 2015 - 05:54 PM

View Posthteee, on 22 July 2015 - 05:22 PM, said:

It would still do the exact same thing so there's no point?

No it would not. First off, it would not depend on certain files or folders. In custom filesystem environments the 'rom' folder might actually be removable. Also, something you might encounter more often are folders of disks in disk drives. Plus, other mods might add their own disk-like folders.

#9 Scoptile

  • Members
  • 36 posts
  • LocationYes. (Location does mean wanted in 12 countries, right?)

Posted 22 July 2015 - 07:15 PM

Well it still says 'Poof!' so thats a plus

#10 Zenon

  • Members
  • 50 posts

Posted 05 August 2015 - 11:10 PM

View PostScoptile, on 22 July 2015 - 07:15 PM, said:

Well it still says 'Poof!' so thats a plus

Gotta have that "Poof!" in there :P





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users