Jump to content




Emergancy Shutdown Floppy, Is It Possible?


5 replies to this topic

#1 Pigbear

  • Members
  • 6 posts

Posted 04 August 2013 - 07:30 PM

Emergancy Shutdown Floppy disks, Are they possible to make? If so that may be pretty useful.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 04 August 2013 - 07:40 PM

What would an "emergency shutdown floppy" do?

#3 Pigbear

  • Members
  • 6 posts

Posted 04 August 2013 - 07:44 PM

Shut down a computer.

#4 campicus

  • Members
  • 164 posts

Posted 04 August 2013 - 09:13 PM

Firstly, I don't know.
Secondly, some advice before a pro gets on and gives you better info. You would need a function like:

function turnOff()
    while true do
        local event, side = os.pullEvent()
        if event == "disk" then
            os.shutdown()
        end
        sleep(1)
    end
end

Which runs parallel to whatever your program is doing in the meantime. This might work?

#5 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 05 August 2013 - 02:04 AM

View Postcampicus, on 04 August 2013 - 09:13 PM, said:

Firstly, I don't know.
Secondly, some advice before a pro gets on and gives you better info. You would need a function like:

function turnOff()
    while true do
        local event, side = os.pullEvent()
        if event == "disk" then
            os.shutdown()
        end
        sleep(1)
    end
end

Which runs parallel to whatever your program is doing in the meantime. This might work?
sleep(1) might cause you to miss a disk event if it happens in that one second after a different event.

No, you can't make a floppy that shuts down a computer when inserted, unless the computer is already running code which expects that possibility.

#6 GopherAtl

  • Members
  • 888 posts

Posted 05 August 2013 - 02:07 AM

immibis is correct; Just want to add that if you need to shut down a computer in a hurry, your best bet is ctrl+s, which will force a computer to shut down, whether the program wants to or not.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users