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

Eject Disk Without Ejecting Disk

Started by Imque, 16 April 2013 - 10:51 PM
Imque #1
Posted 17 April 2013 - 12:51 AM
how can I tell the computer that the disk has ejected or isn't there but it really still is?
theoriginalbit #2
Posted 17 April 2013 - 12:53 AM
what?
Bubba #3
Posted 17 April 2013 - 01:05 AM
Do you mean how do you hide the /disk/ folder so that other people cannot access it? I would use function replacement.

Replace fs.list and fs.open functions to not allow the /disk/ folder to be accessed.
SuicidalSTDz #4
Posted 17 April 2013 - 01:42 AM
You can tell when a disk is ejected by using the disk_eject event. However, the disk would no longer be in the drive if the event fired. So, I don't think I understand the second part of your question.
Engineer #5
Posted 17 April 2013 - 02:09 AM
You can use the disk.isPresent(string side) function

for _,v in pairs(peripheral.getNames()) do
   if periheral.getType( v ) == "drive" then
      if disk.isPresent( v ) then
           print("Disk is in the drive!")
      end
   end
end

I hope this answers your question :P/>

Off-topic: SuicidalSTDz check your PM! D:
H4X0RZ #6
Posted 17 April 2013 - 02:14 AM
He want to tell the computer that there isn't a card but there is a card.
I don't know how you can handle it but I have seen that somebody doesn't understand he ^^
Sora Firestorm #7
Posted 17 April 2013 - 01:30 PM
I believe the OP wants to unmount the disk. (At least, that fits with my definition of 'unmount', removing access without removing the disk, essentially)
Having said that, I do not believe there is a way to do such, unless you do something with function replacement, as already mentioned.