Jump to content




Simple Stripmine / Clear a floppy disk


  • You cannot reply to this topic
4 replies to this topic

#1 PiiNGPooNG

  • New Members
  • 2 posts

Posted 02 March 2013 - 09:38 AM

First I want to know how to make a simple Stripmine which digs 2 blocks high and 1 block thick.

Like if you type in the turtle:
turtle.dig()
turtle.forward()
turtle.digUp()

And this for 50blocks.

Second question: Can I clear a floppy?
If yes. How can i clear it?

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 March 2013 - 10:55 AM

Split into new topic.

for i = 1, 50 do
  turtle.dig()
  turtle.forward()
  turtle.digUp()
end

Delete the contents of the floppy and clear its label.

#3 PiiNGPooNG

  • New Members
  • 2 posts

Posted 02 March 2013 - 11:19 AM

But how do I delete the contents?


#4 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 02 March 2013 - 11:25 AM

View PostPiiNGPooNG, on 02 March 2013 - 11:19 AM, said:

But how do I delete the contents?

From the shell, type "cd /disk" to navigate to the disk directory. Type "ls" to see all the files, and type "rm [program]" to remove programs you want. Type label to see all arguments (including a way to unlabel a disk).

In a program, an easy way to delete the entire contents of a directory would be to do something like the following:
for i,v in pairs(fs.list("/disk")) do
  fs.delete(fs.combine("/disk/", v))
end 


#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 March 2013 - 11:26 AM

Manually, you can use the delete program (or its alias rm); automatically, you could use fs.list and fs.delete:

for _, file in pairs(fs.list("/disk")) do
  fs.delete("/disk/"..file)
end






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users