[comp.sys.mac.programmer] File Mgr Questions

6500stom@hub.UUCP (12/24/89)

What do the bits in VCBAtrb field mean? IV-177 sez that:
	0-4 something about inconsistencies
	6   set if volume is busy
	7   set if volume is locked by hardware
	15  set if volume is looked by software

When I checked out my HDs and floppy I found that bit 6 was always
set and bit 5 was set only on my HDs. Bit 9 was set only on my
floppy.

The reason I want to know this stuff is because I'm trying to write
a substitute for SFDialog and I need to know if I can eject a volume.

Does anyone know how to detect when a volume is mounted or dismounted
without watching disk insert events or scanning the volume indexes?
Does anyone know where SFDialog gets the volume's SICNs? How do you
know if your talking to a floppy or an HD? Is it a good idea to use
the mod date to see if a volume has changed? If Finder checks the
mod date why doesn't it do it more often?

Thanx in advance.

/            Josh Pritikin             T It takes real genus to see    \
| Internet:  6500stom@ucsbuxa.ucsb.edu | the obvious.                  |
| AppleLink: Josh.P                    | Just don't say no if they     |
\ GEnie:     J.Pritikin                ! don't ask you.                /

keith@Apple.COM (Keith Rollin) (12/26/89)

In article <3412@hub.UUCP> 6500stom@hub.UUCP writes:
>What do the bits in VCBAtrb field mean? IV-177 sez that:
>	0-4 something about inconsistencies
>	6   set if volume is busy
>	7   set if volume is locked by hardware
>	15  set if volume is looked by software
>
>When I checked out my HDs and floppy I found that bit 6 was always
>set and bit 5 was set only on my HDs. Bit 9 was set only on my
>floppy.
>
>The reason I want to know this stuff is because I'm trying to write
>a substitute for SFDialog and I need to know if I can eject a volume.
>
>Does anyone know how to detect when a volume is mounted or dismounted
>without watching disk insert events or scanning the volume indexes?
>Does anyone know where SFDialog gets the volume's SICNs? How do you
>know if your talking to a floppy or an HD? Is it a good idea to use
>the mod date to see if a volume has changed? If Finder checks the
>mod date why doesn't it do it more often?

Josh,

You can find out if a volume is ejectable or not by using the control call
described in Inside Mac V, p.470-471. Control call #23 returns, among other
things, a bit that says whether or not a volume is ejectable. If the driver
does not support this call number, then you can fall back on the information
on page II-128, where it discusses the 4 bytes that preceed the drive queue
entry. If you have access to our Q&A stack, then you can find all of this
information in there.

Standard File hardcodes its icons. They are not SICNs or anything like that
at all. They are DC.W's embedded in the source code. It determines which one
to use by looking at the size of the drive. If it's over some arbitrary limit
like 2 meg, then it uses the hard disk icon. Otherwise, it uses the floppy
drive icon.

I don't know about the mod date business. It seems to me that updating of the
modification date is inconsistant. For instance, say you have folder B within
folder A which is on hard disk H. Also say that you add a file to folder B. The
mod date for folder B will reflect the date/time when you added the file, but
the mod date for folder A will not. I don't know how this affects the mod date
for hard disk H without playing around with it some.
 
Please be careful how you use your standard file replacement. Remember that
MultiFinder patches StdFile so that it can fake an already running application
into opening a document that is double-clicked on in the Finder. If you don't
replease the actual PACK resource and call the normal PACK traps for StdFile,
your application will not take advantage of this hack...uh, feature.

-- 
------------------------------------------------------------------------------
Keith Rollin  ---  Apple Computer, Inc.  ---  Developer Technical Support
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions