ThinkC Locate the current System Folder

  • It's #MARCHintosh 2025! Join in on the fun and post your project or play with some new stuff in our #MARCHintosh 2025 thread.
Relating to ThinkC Development

eric

Administrator
Staff member
Sep 2, 2021
1,025
1,709
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
90
39
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.