This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Dr_Zarreh's profile picture

How do you delete everything possible?

Started by Dr_Zarreh, 10 May 2012 - 03:51 PM
Dr_Zarreh #1
Posted 10 May 2012 - 05:51 PM
Long story short, how would you create a disk to basically wipe a computer?
MysticT #2
Posted 10 May 2012 - 05:57 PM
Try with this:

for _,file in ipairs(fs.list("/")) do
  if not fs.isReadOnly(file) then
    fs.delete(file)
  end
end
It's not tested, but it should delete every file and directory in the root directory, leaving only the rom folder (wich can't be deleted).
Dr_Zarreh #3
Posted 10 May 2012 - 06:25 PM
It worked.
MysticT #4
Posted 10 May 2012 - 06:26 PM
Good to know, just don't use it for evil :)/>/>
Dr_Zarreh #5
Posted 10 May 2012 - 06:31 PM
Lol, i only needed one of those because i screwed up two computers. One was a virus, one was a attempt at creating a network that displays a log of computers startups and actions on one giant monitor.