[comp.sys.mac.programmer] PBGetCatInfo question

CXT105@psuvm.psu.edu (Christopher Tate) (10/11/90)

Are indexed calls to PBGetCatInfo() guaranteed to return file/folder
names in alphabetical position?  That is, if I start with 1 and call
PBGetCatInfo() for every index, one at a time, until I get an error,
are the names of the folders/files that I've looked at in alphabetical
order?

Or, do I have to alphabetize my list of file/folder names myself,
after going through the above procedure?

-------
Christopher Tate                   |
cxt105@psuvm.psu.edu               |  You can lead a horse to water,
 ..!psuvax1!psuvm.bitnet!cxt105    |    but a vest has no sleeves.
cxt105@psuvm.bitnet                |

blob@Apple.COM (Brian Bechtel) (10/11/90)

CXT105@psuvm.psu.edu (Christopher Tate) writes:

>Are indexed calls to PBGetCatInfo() guaranteed to return file/folder
>names in alphabetical position?  That is, if I start with 1 and call
>PBGetCatInfo() for every index, one at a time, until I get an error,
>are the names of the folders/files that I've looked at in alphabetical
>order?

>Or, do I have to alphabetize my list of file/folder names myself,
>after going through the above procedure?

PBCatInfo() currently returns file/folder names in alphabetical order on
HFS disks.  There is no guarantee that this behavior will be true on
disks created by other file systems such as MS-DOS, ISO 9660, High
Sierra, Apple II, etc. which can be read by the Macintosh.

The behavior may still be there; it just isn't guaranteed.

--Brian Bechtel		blob@apple.com		"My opinion, not Apple's"

n67786@lehtori.tut.fi (Nieminen Tero) (10/11/90)

In article <45563@apple.Apple.COM> blob@Apple.COM (Brian Bechtel) writes:

   CXT105@psuvm.psu.edu (Christopher Tate) writes:

   >Are indexed calls to PBGetCatInfo() guaranteed to return file/folder
   >names in alphabetical position?  That is, if I start with 1 and call
   >PBGetCatInfo() for every index, one at a time, until I get an error,
   >are the names of the folders/files that I've looked at in alphabetical
   >order?

   >Or, do I have to alphabetize my list of file/folder names myself,
   >after going through the above procedure?

   PBCatInfo() currently returns file/folder names in alphabetical order on
   HFS disks.  There is no guarantee that this behavior will be true on
   disks created by other file systems such as MS-DOS, ISO 9660, High
   Sierra, Apple II, etc. which can be read by the Macintosh.

   The behavior may still be there; it just isn't guaranteed.

   --Brian Bechtel     blob@apple.com        "My opinion, not Apple's"

----- End of quoted articles ----

I think the above will not hold for most foreign lanquages, including the
scandinavian lanquages. It is true for English though.

Just thought I ought to mention it.

-----------------------------------------------------------------------
   Tero Nieminen                    Tampere University of Technology
   n67786@lehtori.tut.fi                Tampere, Finland, Europe
-----------------------------------------------------------------------
--
-----------------------------------------------------------------------
   Tero Nieminen                    Tampere University of Technology
   n67786@lehtori.tut.fi                Tampere, Finland, Europe
-----------------------------------------------------------------------

eastman@csa2.lbl.gov (JACK EASTMAN) (10/11/90)

In article <45563@apple.Apple.COM>, blob@Apple.COM (Brian Bechtel) writes...
>CXT105@psuvm.psu.edu (Christopher Tate) writes:
> 
>>Are indexed calls to PBGetCatInfo() guaranteed to return file/folder
>>names in alphabetical position?  That is, if I start with 1 and call
>>PBGetCatInfo() for every index, one at a time, until I get an error,
>>are the names of the folders/files that I've looked at in alphabetical
>>order?
> 
>>Or, do I have to alphabetize my list of file/folder names myself,
>>after going through the above procedure?
> 
>PBCatInfo() currently returns file/folder names in alphabetical order on
>HFS disks.  There is no guarantee that this behavior will be true on
>disks created by other file systems such as MS-DOS, ISO 9660, High
>Sierra, Apple II, etc. which can be read by the Macintosh.
> 
>The behavior may still be there; it just isn't guaranteed.
> 
>--Brian Bechtel		blob@apple.com		"My opinion, not Apple's"

Be careful here to define what you mean by "alphabetical order".  I know that 
indexed calls to _HGetFInfo return files in ASCII order, not the option-blind
order used by the Finder; so file names beginning with option-characters will
be interposed among non-option-character-named files in the Finder's View by
Name, but will come at the end of a list generated by indexed _HGetFInfo.
I don't know how _GetCatInfo behaves in this regard.

					Jack Eastman
					Berkeley Systems, Inc.
					eastman@lbl.gov