[comp.sys.mac] Mac programming question

neil@dsl.cis.upenn.edu (Neil Radisch) (01/30/88)

How does one tell SFGetfile that you want it to list files from a directory
other than the current one. I've tried various system calls to set the
default volume but SFGetfile still starts out by listing the files in
the directory that the application was in.

No generalizations please

thanks

|----------------------------------------------------------------------------|
| "Better to remain quiet and be thought a fool than to speak out and remove |
|  all doubt" --- Abraham Lincoln                                            |
|                                                                            |
|  neil@dsl.cis.upenn.edu.UUCP                                               |
|----------------------------------------------------------------------------|

km@cadre.dsl.PITTSBURGH.EDU (Ken Mitchum) (02/07/88)

In article <3207@super.upenn.edu> neil@dsl.cis.upenn.edu.UUCP (Neil Radisch) writes:
>How does one tell SFGetfile that you want it to list files from a directory
>other than the current one. I've tried various system calls to set the


Two globals contain the information used by the SF routines to decide
what directory they are in:

(int) SFSaveDisk  -  contains the negative of the volume (NOT a working
directory number).

(long) CurDirStore contains the directory ID of the directory.

Set these before calling the SF routines, and they will use the volume and
directory you specify.

See PBGetVol() and PBGetWDInfo() for routines that convert working directory
numbers to/from real directory numbers. (A working directory number is like
a volume ref number, and is what is returned by the SFGetFile() call if
you are using HFS. You need to convert this to a true volume number and true
directory number.

-ken mitchum
univ of pgh. DSL