Thread View: net.micro.mac
2 messages
2 total messages
Started by Tim Pointing
Tue, 08 Jan 1985 12:01
Help on folders
Author: Tim Pointing
Date: Tue, 08 Jan 1985 12:01
Date: Tue, 08 Jan 1985 12:01
14 lines
1166 bytes
1166 bytes
Help! I am trying to write a disk-backup program which will back up
a MacIntosh disk onto a UNIX-host filesystem. What I am having troubles
with now are folders... There seems to be precious little information
in my copy of Inside Mac about folders. It would seem that the folders
on a disk are actually coming from a resource in the desktop (type 'FOBJ').
My 2 questions are: How do I find out what folders are on a disk?
and
How do I create a new folder? (I want to be able to restore the disk
a close to the way it was as is possible.)
--
Tim Pointing, DCIEM
{allegra,ubc-vision,linus,ihnp4,uw-beaver,floyd}!utcsrgv!dciem!tim
or {allegra,ihnp4,linus,decvax}!utzoo!dciem!tim
Re: Help on folders
Author: Ned Horvath
Date: Thu, 10 Jan 1985 05:34
Date: Thu, 10 Jan 1985 05:34
41 lines
2833 bytes
2833 bytes
You doped it correctly, folders exist only as "virtual" objects, i.e. as resources of type FOBJ in the Desktop. Note that THE Empty Folder has resource ID -1 -- this fits nicely into Inside Mac's folder ID structure of >0 User-defined folders 0 the disk folder -2 the desktop (background) -3 trash Note that you can rename an existing folder 'Empty Folder' (or 'Trash') without drawing a complaint from the finder: it KNOWS that -1 (-3) is the 'true' Empty Folder (Trash). A couple of hours of staring at the Desktop with FEdit will reveal a fair amount of information (I don't have my notes handy) like the folder's name, the window and location of its icon, and the portRect and coordinate origin of its window when open. I haven't yet done the experiment of reading in FOBJ -1, duplicating it, and adding the resource back to the Desktop with a new id an name, but I wouldn't bet a lot of money on being able to fool the Finder that easily (read: I can't account for about half the data in the FOBJ resource!). However, all this stuff is NOT documented in Inside Mac, apparently an intentional omission: the rumor (oft-repeated in these circles of late) is that Apple is still trying to construct a 'true' hierarchical directory structure, thus there is a new Finder on the way, and they don't want to publish the current implementation lest they get committed to it. What IS documented, and hence what you CAN exploit (he said, with a straight face), is the fdFldr in each file's finder information (FInfo) -- see the File Manager doc -- which is indeed the resource ID of the FOBJ for that folder. Since any backup of a disk is going to require that you extract and backup the FInfo anyway, you might as well download and use SetFInfo to restore it. You might as well backup/restore the Desktop file too, thereby capturing all the folders, icons, etc. at one go. The Desktop is currently pretty small -- at least, I have gotten burned when mine approached 10kb. Warning: all of the above is strictly a result of my own observations and best guesses; in particular, documented or not, I wouldn't trust Apple to leave the FInfo struct alone, and I sure wouldn't bet on the FOBJ structure remaining constant. =Ned=
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads