[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Name of drives



If you want to detect a disk insertion, you could be run an "event
loop", the archetypal method for writing a Mac program. Basically, it's
an endless loop:

<WARNING! coding whilst half asleep, on a machine without Perl>

while(!$user_quit) {
  WaitNextEvent();
  $event=$Mac::Events::CurrentEvent->what();
  if ($event == dskEvt) {
    #disk inserted do something here
  }
}

I have no idea if this is even proper Perl, since I'm working on 3.5
hours sleep, and off the top of my head. I have coded event loops in C
and Pascal, so I know it *could* work. :)

There must be examples of a proper event loop out there somewhere. (I
flipped through MPPE (does anyone else call it M-puppy?) and found some
snippets, but nothing complete.)

Geoff

PwrSurge wrote:
> 
> I have a feeling that this is possible; but I am as knowledgeable on
> modules as perl is on programming itself.  :P
> 
> I'd like to know if when a PERL script is executing (specifically, MacPERL)
> - and a disk (floppy, ZIP, SyQuest, whatever) is inserted; I'd like to know
> how to get the name of that disk -OR- how to reference it.  IE drive a:
> 
> I just have this feeling making a script like that, would maintain files
> easily..
> 
> Is that possible?
> 
> --Tim
> 
> --------------------------------------------------------------------------------
> "If the opposite of 'pro' is 'con' ...
>     does that mean the opposite of 'progress' is 'congress'??"  -- Unknown
> --------------------------------------------------------------------------------
> 
> ***** Want to unsubscribe from this list?
> ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch