[comp.sys.mac] What is the Desktop file?

dave@hpdstma.HP.COM (Dave Waller) (05/10/88)

Well... I've been hearing alot about the "desktop" file and I have searched
high and low to find out exactly what it does and how I can manipulate it...
and come up with nothing! Anyway, I'm breaking down and asking the net
if they could give me some info on it:

What does it do?

What can you do to it without some sort of custom program to manipulate it?

And most of all, HOW DO YOU DELETE HIDDEN FILES?? Besides desktop. there
is another hidden file in my System folder that I'm not sure what it's
for (also, I can't remember the name right now and I'm at work) but I know
it's there because I can "see" it with ResEdit. How does one deal with these
ghostly apparitions that are showing up in my system folder??

Thansk for Gdansk in advance,

Dave

barmar@think.COM (Barry Margolin) (05/11/88)

The Desktop file is used by the Finder to keep extra information about
files that only it needs.  It contains copies of all the icons that
are in use for files (so that the Finder doesn't have to open all the
files that it is displaying), it contains the locations of all
applications keyed by their creator string (used to find the
application when you double click on a document), and it contains the
finder comments.  In the MFS file system it also kept all the folder
and icon location information; in HFS this is stored in file system
directories.

As for other invisible files, there are some other applications that
maintain some internal data in invisible files.  I think this used to
be more common than it is now, and it is probably more common with
games.  For example, some game disks have their startup screens in
invisible files.  Finally, some virii may create invisible files; for
example, I think the Scores virus creates an invisible Desktop file in
the System folder (as opposed to the root folder, where the real
Desktop file lives).  Your best bet is to use something like the
DiskInfo DA or ResEdit to look at the creator string of the invisible
file, and then see if you can find an application with that creator.


Barry Margolin
Thinking Machines Corp.

barmar@think.com
uunet!think!barmar

dorourke@polyslo.UUCP (David M. O'Rourke) (05/11/88)

In article <440008@hpdstma.HP.COM> dave@hpdstma.HP.COM (Dave Waller) writes:
>Well... I've been hearing alot about the "desktop" file and I have searched
>high and low to find out exactly what it does and how I can manipulate it...
>and come up with nothing! Anyway, I'm breaking down and asking the net
>if they could give me some info on it:
>
>What does it do?

  The desktop is used by the finder to maintain several lists of information
that it uses while manipulating the directory of a Macintosh disk.  Just
some of the things it keeps in this file are:
   1) I list of Icon's and who they belong to, so that it knows what an
      application and it's documents look like.
   2) A list of applications so that when you "open" a document file the
      finder knows who/what/and where that application can be found so 
      that it can launch it for you.
   3) A list of the comments in the get info window of the file.
   4) Icon positions and window positions for the subdirectories.


>What can you do to it without some sort of custom program to manipulate it?

   This is a file created by the finder, it is not there for you to manipulate.
And besides it's not easy.  If you want to find out how to browse though it I
can recommend "Macintosh Programming Secrets" by Scott Knaster from Addison-
Wesley Publishing.  It give a very lengthy explaination about how to find
icons, comments, ect.  But the format of the Desktop file is not specified
in any "offical" documentation and is one of the most likely canidates for
modification at Apple's slightest wim.
   The relationship's between the various resources is not a simple one, and
I can't think of any reason to manipulate this file directly, except if you're
makeing an alternate finder.  But in that case you could make your own sort of
custom type desktop that your program uses, unless you want your programs
changes to appear in the regular finder.  But I wouldn't recommend messing with
it.

>And most of all, HOW DO YOU DELETE HIDDEN FILES?? Besides desktop. there
>is another hidden file in my System folder that I'm not sure what it's
>for (also, I can't remember the name right now and I'm at work) but I know
>it's there because I can "see" it with ResEdit. How does one deal with these
>ghostly apparitions that are showing up in my system folder??

  You can use ResEdit {by selecting the file name and choosing clear from  the
edit menu}, or any other finder substitute to delete invisible files.  I can
recommend FEdit Plus, DiskTop, and MacTree, or you could whip up a little
application to do it for you.


David M. O'Rourke

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| dorourke@polyslo | Disclaimer:  All opinions in this message are mine, but  |
|                  |              if you like them they can be yours too.     |
|                  |              Besides I'm just a student so what do I     |
|                  |              know!                                       |
|-----------------------------------------------------------------------------|
|    When you have to place a disclaimer in your mail you know it's a sign    |
| that there are TOO many Lawyer's.                                           |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

nagel@ics.uci.edu (Mark Nagel) (05/12/88)

In article <2419@polyslo.UUCP> dorourke@polyslo.UUCP (David O'Rourke) writes:
>>What can you do to it without some sort of custom program to manipulate it?
>
>   This is a file created by the finder, it is not there for you to manipulate.

Well, there *is* a program out there called Layout that will allow you to
modify the Desktop file to some extent.  It basically lets you change the
way icons get layed out on the grid, the font used for file names, the
distances between small icons, etc.  It has a very nice interface and lets
you revert back to the default layout easily.  It's kind of nice to use a
neat-looking cursive font for filenames and to have the icons stagger 
automatically.  If there's enough interest (e-mail me, please!), I will
send this puppy on to the moderator of comp.binaries.mac (although it may
have already appeared there--I don't remember).

Mark D. Nagel    Department of Information and Computer Science, UC Irvine
nagel@ics.uci.edu (ARPA)              {sdcsvax|ucbvax}!ucivax!nagel (UUCP)

benjamin_kuo@pedro.UUCP (Benjamin Kuo) (05/15/88)

  
  It is not so wise to delete the desktop file, which contains ALL your 
comments in the finder, most of the icons, and the folder placement of 
all your files.  And besides that fact, as soon as you delete it the 
file will be reconstructed... 
  
  I advise you to _not_ delete hidden files unless you are positively 
sure of their function.  Deleting any file can be hazardous to your well 
being (and that of your system!).  If you need to delete a hidden file 
for any reason, just use ResEdit, any disk editor, or even a DA like 
DeskZap or DiskTop. 
  
 ----------------------------------------------------------------------- 
    Benjamin Kuo        DISCLAIMER:  I don't work for anyone, so my 
                                     opinions don't matter to them! 
 ----------------------------------------------------------------------- 
 (Couldn't resist one of them -^  :-) 

macak@lakesys.UUCP (Jim Macak) (05/15/88)

In article <483@orion.cf.uci.edu> nagel@ics.uci.edu (Mark Nagel) writes:
>In article <2419@polyslo.UUCP> dorourke@polyslo.UUCP (David O'Rourke) writes:
>>>What can you do to it without some sort of custom program to manipulate it?
>>
>>   This is a file created by the finder, it is not there for you to manipulate.
>
>Well, there *is* a program out there called Layout that will allow you to
>modify the Desktop file to some extent.  It basically lets you change the
>way icons get layed out on the grid, the font used for file names, the
>distances between small icons, etc.  It has a very nice interface and lets
(etc. etc.)

Actually, I believe that Layout goes into the Finder and modifies the
appropriate resource there that determines how things look on the Finder's
desktop window(s).

One could do this by using ResEdit and modifying the correct Finder resource
(I think it is called 'LAYO'?) but the Layout application allows you to
achieve the same result via a well-done user interface.

So, I believe the first writer that is quoted above is correct: the invisible
Desktop file is not intended to be manipulated, and in fact, Layout does not
change it directly.


Jim

-- 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Jim -->  macak@lakesys.UUCP (Jim Macak)  {Standard disclaimer, nothin' fancy!}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

dorourke@polyslo.UUCP (David M. O'Rourke) (05/16/88)

In article <483@orion.cf.uci.edu> nagel@ics.uci.edu (Mark Nagel) writes:
>Well, there *is* a program out there called Layout that will allow you to
>modify the Desktop file to some extent.  It basically lets you change the
> {more information, see original posting}

   Layout does not modify the desktop file.  It modifies a a resource in
the finder called 'LAYO'.  ResEdit knows about this resource and it will allow
you to modify it also.  Layout simply changes some flags to the finder 
about the method used to display files, ie.  Icon Line up, Filename Font, ect..
  It doesn't modify the desktop file directly, it does cause the desktop 
file to be modified the next time the finder is launched, but for example
if you set the grid to the on position and go back and look at the files,
their positions will be the same as they were before you  turned the grid on.
BUT!!!!  If you now try and drag the icons they will only fall into grid
positions.


David M. O'Rourke

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| dorourke@polyslo | Disclaimer:  All opinions in this message are mine, but  |
|                  |              if you like them they can be yours too.     |
|                  |              Besides I'm just a student so what do I     |
|                  |              know!                                       |
|-----------------------------------------------------------------------------|
|    When you have to place a disclaimer in your mail you know it's a sign    |
| that there are TOO many Lawyer's.                                           |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++