[comp.sys.mac.hypercard] XFCN to return directory name

stone@hydra.unm.edu (Andrew Stone) (01/18/90)

Is there an  XFCN for returning a folder name yet? And then get a list of
say, all 'TEXT' docs in that directory?

The reason I ask is that I need to be able to read in each text document
in any given folder, a sort of "foreach" script.

I hate to re-invent the wheel... but I will if I have to.

Thanks

Andrew

||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||
!!         Andrew Stone             !!          Stone Design Corp.      !!
!!      stone@hydra.unm.edu         <>      Albuquerque, New Mexico     !!
||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>|| 

zben@umd5.umd.edu (Ben Cranston) (01/19/90)

In article <1326@ariel.unm.edu> stone@hydra.unm.edu (Andrew Stone) writes:

> Is there an  XFCN for returning a folder name yet? And then get a list of
> say, all 'TEXT' docs in that directory?

I wrote one (just a simple interface to ioDirIndex call to GetCatInfo) as a
simple project to see if I could do an XFCN in assembly code.  There must be
a canonical (probably third or fourth generation) one out there.  I'd be glad
to give mine out.

I always wanted to extend it to return the names of all the mounted volumes,
so you could use it to do a complete filesystem scan.  Would entertain
suggestions...

Here's some info:

*
* Hypercard XCMD to scan the members of an HFS directory.
*
* Call:   DirInfo objectname index
*
* If index not present, returns information about objectname
* Otherwise index'th member object of directory objectname
*
* Information is returned in these Hypercard global variables:
*
* DIResult Global var for result
*    'DirInfo 1 Bad number of arguments'
*    'DirInfo 2 Non digit in index number'
*    'DirInfo 3 Error in GetCatInfo call'
*    'DirInfo 4 Error in GetCatInfo(x) call'
*    'DirInfo 5 Error in Hypercard Callback'
* DIObjType	Type (dir/file)
*    'File'
*    'Directory'
* DIObjName	Object name
* DINumObj	If directory, number of objects in directory
* DIFileType	File type (4 letters)
* DIFileCreator	File creator signature (4 letters)

-- 
Sig     DS.L    ('ZBen')       ; Ben Cranston <zben@Trantor.UMD.EDU>
* Network Infrastructures Group, Computer Science Center
* University of Maryland at College Park
* of Ulm