Volume Mount Message
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Volume Mount Message
Is there a way to get a message when a volume is mounted?
Also, a command to unmount a volume?
Thanks!
Also, a command to unmount a volume?
Thanks!
Re: Volume Mount Message
Hi Smoke,
Yes,
the volumes() function return the list of volumes (one volume by line)
Best
Jean-Marc
Yes,
the volumes() function return the list of volumes (one volume by line)
Best
Jean-Marc
https://alternatic.ch
Re: Volume Mount Message
Thanks Jean-Marc,
But I would have to run an idle handler to constantly query the volumes to know when a new volume is mounted, no?
I was hoping for a message that could trigger a handler?
But I would have to run an idle handler to constantly query the volumes to know when a new volume is mounted, no?
I was hoping for a message that could trigger a handler?
Re: Volume Mount Message
Hi Smoke,
Best
Jean-Marc
Yes. You can do it but maeby someone have a best wayBut I would have to run an idle handler to constantly query the volumes to know when a new volume is mounted, no?
Best
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 10058
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Volume Mount Message
The rate at which idle messages are fired is governed by the idleRate property, so you could use it and minimize overhead by setting it to something higher than the default value of 200.
You may also consider a timer instead - this example uses "send in <time>" to generate a VolumeChanged message:
You could enhance that to walk through the list to find which volumes have been added or removed and add that as argumens to the VolmesChanges notification it sends.
You may also consider a timer instead - this example uses "send in <time>" to generate a VolumeChanged message:
Code: Select all
local sLastVolumes
on CheckVolumesChanged
if the volumes <> sLastVolumes then
dispatch "VolumesChanged" to this cd
end if
put the volumes into sLastVolumes
send "CheckVolumesChanged" to me in 500 millisecs -- or whatever interval you feel is appropriate
end CheckVolumesChanged
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Volume Mount Message
You can do this through an external and that would save you from having to poll with the idle command..
Re: Volume Mount Message
Cool. Where would I find such a beast?shaosean wrote:You can do this through an external..
Re: Volume Mount Message
You would either need to write it yourself, or get someone to write it for you..
Re: Volume Mount Message
I have not written externals for Rev before. Is there an SDK? Some example shells?