182 posts
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?
7508 posts
Location
Australia
Posted 17 April 2013 - 12:53 AM
what?
1190 posts
Location
RHIT
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.
1511 posts
Location
Pennsylvania
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.
1522 posts
Location
The Netherlands
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:
1583 posts
Location
Germany
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 ^^
92 posts
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.