ADC Home > Reference Library > Technical Notes > Legacy Documents > Carbon >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
20 mounted volume limitationDate Written: Last reviewed: How many mounted volumes does the Macintosh support? I've heard that during startup the Macintosh mounts only the first 20. I'm writing a system extension that will boot additional volumes because we need them to be available when the system starts up. Mounting the extra volumes is no problem but once inside an application going to the desktop in an open dialog freezes the applications. Is there any documentation of this problem or this topic? ___ The reason all the disk partitions aren't mounted at boot time is an Event Manager limitation. The Event Manager can queue only 20 events. Depending on what else is going on at boot time that might post an event (or events), you'll probably get only somewhere between 15 and 20 volumes mounted. The lockup/crash problem is caused by a Standard File limitation. Standard File (under System 7) works only with up to 20 mounted volumes. Any more than that and Standard File trashes its own local variables. We've filed a bug report against Standard File for this behavior. The Radar bug system number for this is #1070708 if you need to refer to it in the future. As a workaround until the Standard File limitation is fixed, you can use shared folders to reduce the number of mounted volumes on an AppleShare server. PBGetVolMountInfoSize & PBGetVolMountInfo doc fixDate Written: 2/3/93 Last reviewed: 6/14/93 Our code crashes when we call ___ The documentation is missing a parameter for both calls; In Inside Macintosh: Files, page 2-220, and Inside Macintosh Volume VI, page 25-48, the parameter block passed to PBGetVolMountInfoSize should look like this: Parameter block
In Inside Macintosh: Files, page 2-220, and Inside Macintosh Volume VI, page 25-48, the parameter block passed to PBGetVolMountInfo should look like this: Parameter block
FSWrite and error handling for dskFulErrDate Written: 10/9/92 Last reviewed: 6/14/93 If I call ___ In the current implementation of the file system, writes to local volumes owned by the file system are an all-or-nothing deal. If the space for a write can't be allocated, the write call fails and no bytes are written. However, do not depend on that, because the Macintosh file system doesn't control all volumes that might be mounted. Today, Apple ships four external file systems: CD-ROM, AppleShare, ProDOS File System (for Apple II ProDOS volumes), and PC Exchange (for MS-DOS volumes). Various third parties have written other external file systems. The way they react to error conditions may not be the same as local volumes controlled entirely by the file system. To make your application always work correctly, you should check for errors and
handle them appropriately. If you get a PBHSetVolParms volume attribute bitsDate Written: 7/29/92 Last reviewed: 3/1/93 I'd like to change ___ A disk driver has no say in what volume attribute bits are returned by
The System 7 file system sets these three volume attribute bits on every local
HFS volume: An example of an external file system is AppleShare. For AppleShare volumes,
the AppleShare external file system sets these volume attribute bits:
There isn't a way to keep a volume from being shared if it's mounted when Macintosh File Sharing or AppleShare starts up. The file system doesn't give the file servers a way to tell which volumes should not be shared, so the file servers uses this method:
As you can see, your disk driver doesn't have control over any of that. ioVAtrb bit 7 and bit 15 locked volume bitsDate Written: 8/15/90 Last reviewed: 6/14/93 I want to determine whether a disk is locked before trying to mount the volume.
When I examine bit 15 of ioVAtrb using ___ The reason for your observed discrepancy is that bit 15 is set for a software
lock and bit 7 is set for a hardware lock. In the case of the CD-ROM there's no
software lock but only a hardware lock, so bit 7 is set and bit 15 is clear.
Volumes II and IV of Inside Macintosh both say that "only bit 15 can be
changed" and should be set if the volume is locked. The fact that you can set
it with How to display mounted volumes in a dialog boxDate Written: 11/1/90 Last reviewed: 6/14/93 In a MacApp Pascal program, how can I display all mounted volumes in a dialog box including each volume's icon and name (similar to the way the Finder displays volumes)? I cannot get the resource ID of the icons. ___ Inside Macintosh IV-223 and V-469 describe how to read a volume's ICON.
"The Disc Driver" discusses Distinguishing between Macintosh vRefNums and WDRefNumsDate Written: 12/3/90 Last reviewed: 6/14/93 How do I find the real Macintosh ___ Here's the way to tell the difference between vRefNums and WDRefNums (copied from the Macintosh Technical Note "HFS Ruminations": A A A When you pass a real
Remember that working directories are provided simply to facilitate
compatibility between HFS and programs that were written under MFS. You should
be converting working directories to their corresponding Technique for maintaining up-to-date list of Macintosh volumesDate Written: 6/7/91 Last reviewed: 6/14/93 How can my Macintosh application maintain an up-to-date list of active volumes? Is there a way to detect if a volume is ejected? ___ No event is posted, and no other notification is available for when a volume is
ejected. The best way of keeping your list of volumes up to date is to index
periodically through all mounted volumes with It's probably best to do this check also on every resume event, in case the
user ejects a disk while in the Finder. The periodic check is still necessary,
however, in case a Desk Accessory in your own heap ejects a disk or the user
hits command-shift-1 or 2. Since you probably don't want to check every call
through Unlocking a Macintosh volumeDate Written: 6/14/91 Last reviewed: 11/19/91
___ DTS discourages developers from locking and unlocking volumes through software because it's not readily apparent to users. Many users are aware only of the physical reasons that they would be prevented from modifying a disk. For example, it's easy to identify CD-ROMs and locked floppies as unchangeable. Additionally, the Finder caches the contents of its windows, so a change in the locked status of a volume may not be reflected immediately. An unlocked volume may still show a lock icon in its window, misleading users into thinking that the particular volume is still protected. For these reasons, we recommend that volumes not be locked by software. If you need to software lock a volume, be sure it's done only after explicitly warning the user that the disk will be locked and providing an opportunity to cancel the operation. Locking a volume is done by calling
The VCB queue and volume attributes are discussed under "Volume Control Blocks" in the File Manager chapter of Inside Macintosh Volume IV. Booting a write-protected disk under System 7Date Written: 9/18/91 Last reviewed: 10/15/91 How do I boot a write-protected disk under System 7? It seems that the Macintosh operating system tries to write/modify the desktop file and I get an error message telling me to write-enable the disk. ___ Every Macintosh has been equipped with the ability for users to boot from both write-protected as well as writeable disks, all the way back to the first machine introduced in 1984. This didn't change with System 7; in fact, the operating system has only an indirect impact on this capability. The only thing you can't do from a write-protected boot disk is use the Chooser because the O/S needs to be able to write back the preferences for whatever you do in the Chooser. You might be encountering the error you described because of desktop changes: Since the desktop file was obsoleted in System 7, which now uses the Desktop Manager instead, diskettes that are mastered on a System 7 machine then inserted into another machine running 6.0.x must have a desktop file created. (This does not apply to diskettes that you're trying to boot from; rather, when you insert the disk into a machine already running 6.0.x.) When this situation is encountered, the user is presented with the now familiar dialog to the effect that the disk needs minor repairs (in fact, it needs a desktop file). If you say OK to this dialog, the desktop file will be created and all will be well. All this leads up to how (not) to treat diskettes mastered under System 7: If you drag a series of files to a floppy disk (from a System 7 machine), immediately eject and lock it, then try to boot from it, the machine will try to update the directory information on the diskette as the machine is booting up. The way around this is to either A) eject the floppy after copying your files then reinsert it (or simply open and close the main window) to allow the directory information to be updated or B) use the installer to place files on the floppy as the installer automatically updates the directory information. Another possible explanation for the anomolous behavior you're seeing is that you've got an INIT or application of some sort (such as a virus checker perhaps) on the floppy that wants to update itself after the system has finished starting up. Changing a volume's modification dateDate Written: 12/9/91 Last reviewed: 6/14/93 Why can't I use ___ The modification date shown for a volume in its Get Info window in the Finder
is not actually the mod date as recorded in the volume's VCB. Rather, it is the
mod date of the root folder. The VCB mod date as returned by An application should not need to change the modification date of a volume as
it appears in the disk's Get Info window. However, it can be done by calling
PBSetCatInfo to set the System 7 DA UnmountVol bugDate Written: 2/26/92 Last reviewed: 6/14/93 I am trying to unmount a volume from a desk accessory using the UnmountVol
trap. Unmounting network volumes works fine. However, unmounting a floppy ends
up giving me a stack/heap collision in the ___ This is a bug in System 7, which should be fixed in the next major system release. It only happens with native (local) volumes since they are the only ones that use the operating system Unmount code. Network volumes dispatch to an external file system, whose code is likely to be correct. How do I tell if a volume is a floppy or hard disk, or removableDate Written: 11/17/89 Last reviewed: 6/14/93 How do I tell if a Macintosh volume is a floppy or hard disk? ___ What you probably want to know is whether a device in the drive queue is removable. Do this by examining the four bytes of flags proceeding the drive queue entry for the device. See pages 181-2 of Inside Macintosh Volume IV for details. C source is:
If you actually want to know if a volume is a floppy or not, use How will you handle other sizes in the future? Nasty. That's why I hope you are really asking to detect removable media. Where can I find more information about HFS structures?Date Written: 5/3/89 Last reviewed: 11/21/90 Where can I find more information about HFS structures other than in Inside Macintosh? ___ Another source of information besides Inside Macintosh is the MPW
File Manager backup volume info block bug & workaroundDate Written: 3/6/92 Last reviewed: 6/14/93 I found a situation where the Macintosh file system incorrectly updates the
backup volume info block. If the driver for this volume is a qType 1 and the
___ It looks like you're right. That bug is present in the File Manager ROM code on the Macintosh Plus, SE, II, IIx, IIcx, and Classic (everything with the pre-IIci ROMs). The two workarounds are: * Make sure the low word of the logical number of blocks (stored in or * Make sure your driver ignores accesses past the end of the volume. Changing the volume control block modification dateDate Written: 3/11/91 Last reviewed: 6/14/93 How can I change the modification date of my Macintoshreg. external file system
driver's volume control block? I've tried different values in both the vcbLsMod
field of the volume control block and the ___ Some of the volume information is getting magically cached somewhere, and that in order to update it, you must first put the volume offline! I know, it sounds weird, but I've seen the source code to disk copy utilities that do this in order to change that kind of information. So try putting the volume offline before writing the volume info out to it, and then call FlushVol on the volume. Code for identifying vRefNum and DirID of MAC System FolderDate Written: 4/10/91 Last reviewed: 6/14/93 I need to identify the startup volume as I index through all volumes with
___ The code below is general purpose code to identify the
System 7 UnmountVol and Eject calls return positive drive numberDate Written: 4/30/91 Last reviewed: 6/14/93 Why is my Macintosh driver receiving a positive drive number under System 7.0
upon notification of an __ When the "driver wants a call on eject" bit is set in the flag bytes preceding
a drive queue element, However, there's a bug in the ROM that only mainfests itself when The System 7.0 Finder has reversed the order of its calls to A number of driver writers have notified us of this problem, but few (so far)
have been adversely affected. As it has always been possible for utilities or
applications to make X-Refs: Inside Macintosh Volume II, page 214 Inside Macintosh Volume IV, page 181 How to determine if a Macintosh file is on a locked diskDate Written: 1/1/91 Last reviewed: 6/14/93 How do I determine whether a Macintosh file is on a locked disk? ___ Call the function Working directories and unmounted volumesDate Written: 5/4/92 Last reviewed: 6/14/93 When can I unmount a Macintosh volume? I know that if any files (other than Desktop, Desktop DB or Desktop DF) are open, I can't unmount the volume, but I'm not sure about working directories. Will open working directories for that volume prevent the unmount call from working? ___ Open working directories on a volume will not keep the volume from unmounting.
When a volume is unmounted under either System 6 (Finder or MultiFinder) or
System 7, all working directories for that volume are made invalid. Any
attempts to use the working directory number after the volume is unmounted will
result in a Getting open file name on an MFS volumeDate Written: 4/30/92 Last reviewed: 6/14/93
___ The code that deals with MFS volumes and the files on MFS volumes is the same code that has always dealt with MFS. The MFS code that fills in the FCB only knows about the first 30 bytes of the FCB (the 30 bytes documented in Inside Macintosh Volume II on page 127) which does not include the file name and several other pieces of information used by only by HFS. So, there's really no good way to get the file name of an open file on an MFS volume. How Macintosh Finder calculates free and used volume spaceDate Written: 7/1/92 Last reviewed: 6/14/93 How does the Macintosh Finder calculate free, total, and used space on a given volume? The information derived from the fields in the VCB seems to give me the correct volume free space, but the volume used space sometimes is off. ___ The calculation the Finder uses for space used in the Get Info dialog is this:
The Finder doesn't consider space used by the volume's catalog file and extents overflow file to be space used by the "user." We don't normally recommend accessing the VCB directly if at all possible
because it is a compatibility risk, but there is some information you can't get
any other way, such as Downloadables
|
|