Jump to content




Eject Disk Without Ejecting Disk


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

#1 Imque

  • Members
  • 134 posts

Posted 16 April 2013 - 11:51 PM

how can I tell the computer that the disk has ejected or isn't there but it really still is?

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 16 April 2013 - 11:53 PM

what?

#3 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 17 April 2013 - 12: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.

#4 SuicidalSTDz

    Permutator of Strings

  • Members
  • 1,308 posts
  • LocationPennsylvania

Posted 17 April 2013 - 12: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.

#5 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 17 April 2013 - 01: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:


#6 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 17 April 2013 - 01: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 ^^

#7 Sora Firestorm

  • Members
  • 89 posts

Posted 17 April 2013 - 12: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.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users