[comp.sys.amiga.tech] Help! GetDiskObject

icsu8212@caesar.cs.montana.edu (Stone) (12/07/89)

Reply-To: duncant@mbunix.mitre.org (Thomson)
Lines: 21

>I need help on the correct usage of GetDiskObject().  It works fine for me
>when I  use it on a project, tool, trashcan, or drawer icon, but it won't
>work on a disk icon.

>for disk MYDISK: shouldn't I give "MYDISK:" as the argument to GDO(), 
>resulting in "MYDISK:.icon" being read?  (Doesn't work)


You are correct in assuming what is being read.  The problem is, you
are reading the wrong thing.  If you want the disk icon, you should specify
Disk.info.  The .info file by itself only specifies where the workbench window
for that disk will come up (I think).  But I do know that the disk icon is
saved in Disk.info.  If the file does not exist, a default system icon is
used.

--
===============================================================================
    //X\\                       |        icsu8212@caesar.cs.montana.edu
   /// \\\   AMIGA HACKER       |  Murphy's First Law: (un-amended)
  ///         Mike Stone        |          Nothing can possibly go wrong.

duncant@mbunix.mitre.org (Thomson) (12/07/89)

>...  If you want the disk icon, you should specify
>Disk.info.  The .info file by itself only specifies where the workbench window
>for that disk will come up (I think).  But I do know that the disk icon is
>saved in Disk.info.  If the file does not exist, a default system icon is
>used.

Great, thanks.  Next question: if Disk.info does not exist, how can I get
a DiskObject structure which contains all the information (including in
particular the image of the icon) for the above-mentioned default system
icon.  Also, I notice that directories (drawers) often get .info files
lying around in them.  What are these?

Thanks, for the help
Duncan Thomson

doug@xdos.UUCP (Doug Merritt) (12/08/89)

In article <2651@caesar.cs.montana.edu> icsu8212@caesar.cs.montana.edu (Stone) writes:
> If you want the disk icon, you should specify
>Disk.info.  The .info file by itself only specifies where the workbench window
>for that disk will come up (I think).

That's exactly right. The file ".info" is a window snapshot, created by
selecting the SNAPSHOT menu entry from Workbench. There will be one
in every directory in which a snapshot has been taken. It contains the
positions for all windows and icons that were snapshotted.

It's badly named, since it's name looks similar to, but is in fact totally
different from, all other "*.info" files.
	Doug
-- 
Doug Merritt		{pyramid,apple}!xdos!doug
Member, Crusaders for a Better Tomorrow		Professional Wildeyed Visionary

lphillips@lpami.wimsey.bc.ca (Larry Phillips) (12/08/89)

In <8886@cbmvax.UUCP>, mks@cbmvax.UUCP (Michael Sinz - CATS) writes:
>Wrong...   The .info file is a list of icons in the directory that workbench
>uses to load the icons more quicly.  (Does not need to scan the directory)
>This is done via file dates...  A .info file is created whenever you open
>a disk/drawer.  (Assuming there is space and the disk is not write-protected)

It does? Not not my system. I want either whatever you're smoking, or whatever
OS rev you're running. :-)

-larry

--
" All I ask of my body is that it carry around my head."
         - Thomas Alva Edison -
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+

mks@cbmvax.UUCP (Michael Sinz - CATS) (12/08/89)

In article <82035@linus.UUCP> duncant@mbunix.mitre.org (Thomson) writes:
>>...  If you want the disk icon, you should specify
>>Disk.info.  The .info file by itself only specifies where the workbench window
>>for that disk will come up (I think).  But I do know that the disk icon is
>>saved in Disk.info.  If the file does not exist, a default system icon is
>>used.
>
>Great, thanks.  Next question: if Disk.info does not exist, how can I get
>a DiskObject structure which contains all the information (including in
>particular the image of the icon) for the above-mentioned default system
>icon.  Also, I notice that directories (drawers) often get .info files
>lying around in them.  What are these?

the .info file is used as a quick index to the icons in that draw.  Workbench
checks to see if the date stamp on the .info is correct as compaired to the
directory and if so, reads the .info and then displays only the files that
are listed in it.  This helps speed things up as WorkBench does not need to
do a directory search to find all of the icons.

>
>Thanks, for the help
>Duncan Thomson

/----------------------------------------------------------------------\
|      /// Michael Sinz -- CATS/Amiga Software Engineer                |
|     ///  PHONE 215-431-9422  UUCP ( uunet | rutgers ) !cbmvax!mks    |
|    ///                                                               |
|\\\///          When people are free to do as they please,            |
| \XX/                they usually imitate each other.                 |
\----------------------------------------------------------------------/

mks@cbmvax.UUCP (Michael Sinz - CATS) (12/08/89)

In article <571@xdos.UUCP> doug@xdos.UUCP (Doug Merritt) writes:
>In article <2651@caesar.cs.montana.edu> icsu8212@caesar.cs.montana.edu (Stone) writes:
>> If you want the disk icon, you should specify
>>Disk.info.  The .info file by itself only specifies where the workbench window
>>for that disk will come up (I think).
>
>That's exactly right. The file ".info" is a window snapshot, created by
>selecting the SNAPSHOT menu entry from Workbench. There will be one
>in every directory in which a snapshot has been taken. It contains the
>positions for all windows and icons that were snapshotted.

Wrong...   The .info file is a list of icons in the directory that workbench
uses to load the icons more quicly.  (Does not need to scan the directory)
This is done via file dates...  A .info file is created whenever you open
a disk/drawer.  (Assuming there is space and the disk is not write-protected)

>
>It's badly named, since it's name looks similar to, but is in fact totally
>different from, all other "*.info" files.

The name could be called bad, but as the system stands now, file requesters
could just filter all files that end in ".info" and thus not expose the user
to files that he has not created himself.

>	Doug
>-- 
>Doug Merritt		{pyramid,apple}!xdos!doug
>Member, Crusaders for a Better Tomorrow		Professional Wildeyed Visionary

/----------------------------------------------------------------------\
|      /// Michael Sinz -- CATS/Amiga Software Engineer                |
|     ///  PHONE 215-431-9422  UUCP ( uunet | rutgers ) !cbmvax!mks    |
|    ///                                                               |
|\\\///          When people are free to do as they please,            |
| \XX/                they usually imitate each other.                 |
\----------------------------------------------------------------------/

jms@tardis.Tymnet.COM (Joe Smith) (12/11/89)

In article <891@lpami.wimsey.bc.ca> lphillips@lpami.wimsey.bc.ca (Larry Phillips) writes:
>In <8886@cbmvax.UUCP>, mks@cbmvax.UUCP (Michael Sinz - CATS) writes:
>>Wrong...   The .info file is a list of icons in the directory that workbench
>>uses to load the icons more quicly.  (Does not need to scan the directory)
>>This is done via file dates...  A .info file is created whenever you open
>>a disk/drawer.  (Assuming there is space and the disk is not write-protected)
>
>It does? Not not my system. I want either whatever you're smoking, or whatever
>OS rev you're running. :-)

Larry, your stopwatch must not be working right.  :-)

I created 60 files in the root of a floppy, only 6 were *.info files.  It
took Workbench 25.7 seconds to look at all 60 files, determine which ones
were icons, and display their images the first time through.  I ejected the
floppy (to flush out any cached info), re-inserted and double click on its
icon.  This time it took only 6.1 seconds for Workbench to display all the
icons, since it used the list in the .info file and did not have to read the
File Info Blocks of all the non-icon files.  It was consistant - 6 seconds
instead 25 as long as the .info file was up to date.
-- 
Joe Smith (408)922-6220 | SMTP: JMS@F74.TYMNET.COM or jms@gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-D21    | PDP-10 support: My car's license plate is "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga speaks for me."

lphillips@lpami.wimsey.bc.ca (Larry Phillips) (12/14/89)

In <864@tardis.Tymnet.COM>, jms@tardis.Tymnet.COM (Joe Smith) writes:
>In article <891@lpami.wimsey.bc.ca> lphillips@lpami.wimsey.bc.ca (Larry Phillips) writes:
>>In <8886@cbmvax.UUCP>, mks@cbmvax.UUCP (Michael Sinz - CATS) writes:
>>>Wrong...   The .info file is a list of icons in the directory that workbench
>>>uses to load the icons more quicly.  (Does not need to scan the directory)
>>>This is done via file dates...  A .info file is created whenever you open
>>>a disk/drawer.  (Assuming there is space and the disk is not write-protected)
>>
>>It does? Not not my system. I want either whatever you're smoking, or whatever
>>OS rev you're running. :-)
>
>Larry, your stopwatch must not be working right.  :-)
>
>I created 60 files in the root of a floppy, only 6 were *.info files.  It
>took Workbench 25.7 seconds to look at all 60 files, determine which ones
>were icons, and display their images the first time through.  I ejected the
>floppy (to flush out any cached info), re-inserted and double click on its
>icon.  This time it took only 6.1 seconds for Workbench to display all the
>icons, since it used the list in the .info file and did not have to read the
>File Info Blocks of all the non-icon files.  It was consistant - 6 seconds
>instead 25 as long as the .info file was up to date.

Yup...  you are right..  funny, but the last time I looked at this was a few
years ago, and it seemed that it made no difference at all. I was probably
thinking of the total directory time, which remains constant, and of course
very noticable because the snoozing cloud keeps reminding you that the WB is
single-threaded.

I also received an email reply from Michael Sinz, correcting me as well. In
response to that, about all I have to say is that I _never_ put a smiley face
on a flame.

-larry

--
" All I ask of my body is that it carry around my head."
         - Thomas Alva Edison -
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+