So what's the problem? If stdout is FILE_TYPE_CHAR then an output terminal is connected to the application
Regarding macOS - I think this might have some mileage in it...if I can work out how to access it from Lazarus. It should be a simple case of including a unit...just which one? Foundation, according to my install, can't be found (but I know it's there because I opened it).
Assuming that MacOS is a BSD derivative... does it allow you to get at /proc which should be a standard filesystem?
Quote from: MarkMLl on June 22, 2024, 10:17:19 pmAssuming that MacOS is a BSD derivative... does it allow you to get at /proc which should be a standard filesystem?No - it just returned an empty string. The folder 'proc' doesn't exist either, where in Linux is does.
That's weird, it certainly exists on SunOS. Look, most definitely not trying to offend but you /were/ treating it as a directory containing files, weren't you?
MacOS does not have /proc, but you can use sudo fs_usage
{ "COMMAND_MODE" = unix2003; HOME = "/Users/geraldholdsworth"; LOGNAME = geraldholdsworth; PATH = "/usr/bin:/bin:/usr/sbin:/sbin"; SHELL = "/bin/zsh"; "SSH_AUTH_SOCK" = "/private/tmp/com.apple.launchd.35SDrFixwG/Listeners"; TMPDIR = "/var/folders/sp/r7dyc78d19j36ftwtmckmr3w0000gn/T/"; USER = geraldholdsworth; "XPC_FLAGS" = 0x0; "XPC_SERVICE_NAME" = "application.com.company.project1.36549144.37180253"; "__CFBundleIdentifier" = "com.company.project1"; "__CF_USER_TEXT_ENCODING" = "0x1F5:0:2";}
{ HOME = "/Users/geraldholdsworth"; "HOMEBREW_CELLAR" = "/opt/homebrew/Cellar"; "HOMEBREW_PREFIX" = "/opt/homebrew"; "HOMEBREW_REPOSITORY" = "/opt/homebrew"; INFOPATH = "/opt/homebrew/share/info:"; LANG = "en_GB.UTF-8"; LOGNAME = geraldholdsworth; MANPATH = "/opt/homebrew/share/man::"; OLDPWD = "/Users/geraldholdsworth/Library/Mobile Documents/com~apple~CloudDocs/Programming/Lazarus/Old and Test Projects/Console and GUI/lib"; PATH = "/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/VMware Fusion.app/Contents/Public"; PWD = "/Users/geraldholdsworth/Library/Mobile Documents/com~apple~CloudDocs/Programming/Lazarus/Old and Test Projects/Console and GUI/lib/x86_64-darwin"; SHELL = "/bin/zsh"; SHLVL = 1; "SSH_AUTH_SOCK" = "/private/tmp/com.apple.launchd.35SDrFixwG/Listeners"; TERM = "xterm-256color"; "TERM_PROGRAM" = "Apple_Terminal"; "TERM_PROGRAM_VERSION" = 453; "TERM_SESSION_ID" = "1CDE8358-C3EF-492A-955D-6A36DDECAC31"; TMPDIR = "/var/folders/sp/r7dyc78d19j36ftwtmckmr3w0000gn/T/"; USER = geraldholdsworth; "XPC_FLAGS" = 0x0; "XPC_SERVICE_NAME" = 0; "_" = "/Users/geraldholdsworth/Library/Mobile Documents/com~apple~CloudDocs/Programming/Lazarus/Old and Test Projects/Console and GUI/lib/x86_64-darwin/./project1"; "__CFBundleIdentifier" = "com.apple.Terminal"; "__CF_USER_TEXT_ENCODING" = "0x1F5:0:2";}
OK, but couldn't you get that from running env in a terminal? I think that's a standard unix program rather than a Linuxism.
And from a terminal, what happens if you do ls /proc ?
zsh: no such file or directory: /proc