[comp.sys.mac.hypercard] How can I have an HC stack check if it's running from a hard disk?

elliott@veronica.cs.wisc.edu (James Elliott) (04/14/91)

I have a HyperCard stack I'm creating as an entry for a contest, which
makes intensive use of sampled sounds. I would like to have it test to
see if it is being run from a floppy and warn the user that
performance will be miserable if that happens to be the case (because
floppy access mangles sound output horribly). How can I do this?

I'm willing to write an XCMD if someone can point me in the right
direction. If there's an easier way, though, I'd like to use it.

--
Jim Elliott		      "Like a bridge he'll come between us, not a wall"
elliott@veronica.cs.wisc.edu

johnston@oscar.ccm.udel.edu (Bill Johnston) (04/14/91)

In article <1991Apr13.181917.20797@spool.cs.wisc.edu>, elliott@veronica.cs.wisc.edu (James Elliott) writes...
>I have a HyperCard stack I'm creating as an entry for a contest, which
>makes intensive use of sampled sounds. I would like to have it test to
>see if it is being run from a floppy ...

There must be a better way, but ... (using two XFCN's from the SupportTools
eXternals stack):

CurrAppPath returns the full path name of the currently running HyperCard.
(For example, "HD40:HyperStuff:HyperCard".)  Strip away the stuff after the 
first colon and put the rest into volumeName.  Put SCSINameToID(volumeName)
into "temp":  if volumeName isn't a SCSI drive, temp will contain "volumeName
is not a SCSI drive" and you'll know that you are working from a floppy.

-- Bill (johnston@oscar.ccm.udel.edu)

francis@zaphod.uchicago.edu (04/16/91)

In article <50679@nigel.ee.udel.edu> johnston@oscar.ccm.udel.edu (Bill Johnston) writes:

>CurrAppPath returns the full path name of the currently running HyperCard.
>(For example, "HD40:HyperStuff:HyperCard".)  Strip away the stuff after the 
>first colon and put the rest into volumeName.  Put SCSINameToID(volumeName)
>into "temp":  if volumeName isn't a SCSI drive, temp will contain "volumeName
>is not a SCSI drive" and you'll know that you are working from a floppy.

Of course, there are SCSI floppies and non-SCSI HDs out there...

This was a huge discussion on c.s.m.programmer last Fall; conclusion
seemed to be that you can't distinguish hard drive vs. floppy: the
best you can do is check for functionality.  (i.e., if it ejects, it's
a floppy, a CD, or a removable hard disk; check for size to be sure).

--
/============================================================================\
| Francis Stracke	       | My opinions are my own.  I don't steal them.|
| Department of Mathematics    |=============================================|
| University of Chicago	       | Should five percent appear too small,	     |
| francis@zaphod.uchicago.edu  | Be thankful I don't take it all.  "Taxman"  |
\============================================================================/

dlugose@uncecs.edu (Dan Dlugose) (04/18/91)

In article <1991Apr13.181917.20797@spool.cs.wisc.edu> elliott@veronica.cs.wisc.edu (James Elliott) writes:
>I have a HyperCard stack I'm creating as an entry for a contest, which
>makes intensive use of sampled sounds. I would like to have it test to
>see if it is being run from a floppy and warn the user that
>performance will be miserable if that happens to be the case (because
>floppy access mangles sound output horribly). How can I do this?
 
  In the startup script, put

  on openstack
     if the diskspace < 1200000 then
        -- either your hard disk is chock full and you need to
        -- do something else or warn the user of this possibility 
        answer "This needs to run on a hard disk" with
           "continue" or "quit"
      end if
   end openstack

Dan Dlugose
UNC Educational Computing Service
-- 
Dan Dlugose
Internet: dlugose@uncecs.edu
UNC Educational Computing Service
Box 12035, Research Triangle Park, NC 27709-2035

ffdkl@acad3.alaska.edu (LaSota Daniel K) (04/18/91)

>  In the startup script, put
> 
>  on openstack
>     if the diskspace < 1200000 then
>        -- either your hard disk is chock full and you need to
>        -- do something else or warn the user of this possibility 
>        answer "This needs to run on a hard disk" with
>           "continue" or "quit"
>      end if
>   end openstack
> 
>Dan Dlugose
>UNC Educational Computing Service
>-- 
>Dan Dlugose
>Internet: dlugose@uncecs.edu
>UNC Educational Computing Service
>Box 12035, Research Triangle Park, NC 27709-2035
This will not work on certain CD volumes which have zero K free.
Sounds played from the SCSI CD do nicely.

Ant Man!
Dan LaSota
ffdkl@acad3.alaska.edu