ThinkC Locate the current System Folder

  • Hey everyone! We've been having issues with being bombarded by forum spam bots. As a temporary measure we're disabling registration for around 72 hours. Anyone wanting to join up as a legitimate user, please have patience! :)
Relating to ThinkC Development

eric

Administrator
Staff member
Sep 2, 2021
1,050
1,735
113
MN
bluescsi.com
I'm trying find how to open the currently running System file. System Folders can be named anything - just needs to have a System in it.

Is there a Toolbox API to determine the currently running System? My retro usenet search didn't turn up much.
 

joevt

Tinkerer
Mar 5, 2023
97
40
18
Code:
SysEnvRec sysEnv;
OSErr err = SysEnvirons (1, &sysEnv);
sysVRefNum of SysEnvRec is a working directory ID, not a volume reference ID or a directory reference ID.

The currently running System file is always open. So you would get the file reference number (probably just kSystemResFile), and use something like PBGetFCBInfoSync to get more info if you want to know where it is.